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 accomp开发者_运维百科lish this?
Thanks!
Use: CALL SET %%A then.
CALL will itself expand %%A and then SET will expand %HOMEPATH%.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论