I have a .config file that has a list of IP addresses, these IP addresses need updating. I need to update the config file on 115 computers.
I was hoping this could be done in a bat file that will delete the ip addresses already in the file and replaces them
For example it does something along the lines of
in the file c:/settings.config
between the text
<sites default="127.0.0.1">
and
</sites>
delete and replace with
<site ipAddress="192.168.0.1" name="PC1" port="1001" number="1001"/>
<site ipAddress="192.168.0.2" name="PC2" port="1001" number="1002"/>
<site ipAddress="192.168.0.3" name="PC3" port="1001" number="1003"/>
<site ipAddress="192.168.0.4" name="PC4" port="1001" number="1004"/>
<site ipAddress="192.168.0.5" name="PC5" port="1001" number="1005"/>
<site ipAddress="192.168.0.6" name="PC6" port="1001" number="1006"/>
Batch file to edit a .config file
Moderator: DosItHelp
Re: Batch file to edit a .config file
Depending on the content of your file you coudl either use Dave's JREPL.BAT:
--- or you could use xslt to change the xml data; example:
viewtopic.php?p=32941#p32941
penpen
Code: Select all
https://www.dostips.com/forum/viewtopic.php?t=6044
viewtopic.php?p=32941#p32941
penpen