Skip to main content

Posts

Showing posts from January, 2013

MS-DOS and INI file

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: I created a new INI config file and declared my available in it. MyINIFile.ini UserName=MyUserName 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%