Page 1 of 1

Edit and Save and XML with a Batch Script

Posted: 10 Jan 2020 20:40
by Mccorkled
Hello everyone! First time poster long time lurker lol.

I was wondering if someone could help me with something that I’m not even sure is possible. Is the title states, I'm looking to edit a XML with a bat and have the file save and close.

I have a file Z:/Databases/Main Menu/Main Menu.xml

I’d like to run a bat called “insert any name here” and have the bat file name be inserted into the XML in its alphabetically correct location amongst the other lines within the XML between the mine tags, save, and then close.

An example of another line in the XML is <system name=“Microsoft”/> which is between the menu tags.

Thank you. :)

Re: Edit and Save and XML with a Batch Script

Posted: 11 Jan 2020 13:39
by penpen
You could use a bat-jscript hybrid and xslt to change the xml data; example:
viewtopic.php?p=32941#p32941
(Then overwrite the old file with the new one.)

penpen

Re: Edit and Save and XML with a Batch Script

Posted: 12 Jan 2020 01:42
by Mccorkled
I was talking to my buddy tonight and he suggested a .vbs