Edit and Save and XML with a Batch Script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Mccorkled
Posts: 2
Joined: 10 Jan 2020 20:29

Edit and Save and XML with a Batch Script

#1 Post by Mccorkled » 10 Jan 2020 20:40

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. :)

penpen
Expert
Posts: 1819
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Edit and Save and XML with a Batch Script

#2 Post by penpen » 11 Jan 2020 13:39

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

Mccorkled
Posts: 2
Joined: 10 Jan 2020 20:29

Re: Edit and Save and XML with a Batch Script

#3 Post by Mccorkled » 12 Jan 2020 01:42

I was talking to my buddy tonight and he suggested a .vbs

Post Reply