home   articles   tags   browse code   

BATCH - Read Config.ini


 

When formatted a certain way, config.ini files can be read by NT batch scripts (windows).

I have to give credit where credit is due. Google found this one for me, and I am including a sample batch file here for reference. [http://www.computing.net]

config.ini
username=owner
password=mypass


readconfig.bat
@echo off
for /f "tokens=1,2 delims==" %%a in (config.ini) do (
if %%a==username set username=%%b
if %%a==password set password=%%b
)

echo %username%
echo %password%


 

Tags: windows, batch
 


 

 



Related Articles
 



home  |  privacy policy  |  terms of use  |  contact  


©2010, Zedwood Digital