Set an environment variable from a text file contentTag(s): Misc Prog HowTo
Let's say we have the following text file.
This batch file will read the given file and set the environment variable content with the file content.
this is an interesting howto
gives this output
@echo off SetLocal EnableDelayedExpansion set content= for /F "delims=" %%i in (howto.txt) do set content=!content!%%i echo %content% EndLocal
> howto.cmd this is an interesting howto