Hi Guys,
I am very new to batch scripting and i would like to know how could i modify my ini file using a batch script
This is exactly what i need to do:
Update values in Example.ini, the values that i need to update look something like this
[Cache]
Enabled = 1
[Log]
Enabled = 0
[Support]
Line1 = ÿ
Lines = 1
MailSenderAddress = Report@example.com
There is more content above and below these.
I would like my batch script to update [Log] value from 0 to 1 , i.e Enabled = 1
& delete value of MailSenderAddress = , it should be blank.
so updated values should look something like this
[Log]
Enabled = 1
[Support]
Line1 = ÿ
Lines = 1
MailSenderAddress =
I want to automate this so that i can include this batch script in another script (Master Script) which will run and update these values as well apart from its usual job that it does.
Could you guys please help me with this?
Cheers
irish
How to edit .ini file using batch script ??
Moderator: DosItHelp
Re: How to edit .ini file using batch script ??
I'm not sure about the approach, but I think reading the ini into somewhat of an array where each setting below a heading would be identified as being part of that heading. Then you could search the array for the string you want, change it and then rebuild the complete ini file again.
Not an easy task, but I know there's several geniuses on here that can code this 100x faster than I can even think about it.
Not an easy task, but I know there's several geniuses on here that can code this 100x faster than I can even think about it.
