I want to set environment variables based on a text file.
The text file has the following format
name=value
In my script i simply iterate the file and perform a set command:
FOR /F "tokens=* delims=" %%A IN ('type test.ini') DO (
SET %%A
)
The problem is that the text file can contain something like
folder=%HOMEPATH%\test
The set command does not evaluate the %HOMEPATH% environment variable.
Instead of \Users\john\test the variables value is %HOMEPATH%\test.
Is there a way do accomplish this?
Thanks!
Use:
CALL SET %%Athen.CALL will itself expand %%A and then SET will expand %HOMEPATH%.