Batch Edits .ini

May 15, 2011 at 07:02:06
Specs: Windows Vista
I was wondering if anyone knew how to take a .bat file and edit a .ini file
more specifically taking word in the .ini file and changing it to a different word. I have been searching for hours and really want to know. So, is there anyone that knokw how?

See More: Batch Edits .ini

Report •

May 28, 2011 at 01:37:38
if the order of lines in .ini does not matter then i think it can be done..may be someone have better idea as well..

suppose .ini contents below..

name = test
number = 7
phone = 456

and you want to change the value of number .from 7 to 9

lets take a look at the steps ..

serach for string number and get the exact value using a for loop.

@echo off
set /p value="enter the value to change" :
find /v %value% >tempfile.ini
set /p newvalue= "enter the new value for %value% :
echo %value% = %newvalue% >>tempini.ini
type tempini.ini >filename.ini

Untested :(

Subhash Chandra.

Report •
Related Solutions

Ask Question