I came into a requirement where I had to separate a DOS batch file and move all the variable and user specific setting into a separate file.
So here is the solution:
MyINIFile.ini
Datapath=C:\data
ServerName=MyServer
Here is how I am calling the INI file inside the batch file.
MyBatchFile.bat
FOR /F "tokens=1,2 delims=^=" %%A IN (MyINIFile.ini) DO (SET %%A=%%B )
ECHO %Datapath%
ECHO %ServerName%
Comments
Post a Comment