Write to XML Tag

Microsoft Windows xp professional w/serv...
August 28, 2010 at 22:41:12
Specs: Windows XP and Win 7
I am trying to do something that I know I should do with VB or Python, or something like that. But I am limited to Batch for work-related reasons. I have a program that reads commands from an XML file and I just need to change a tag (run) from "Run" to "Stop"

I knew this was going to be difficult, but I'm not finding any information anywhere... Also, this tag could end up being on any line, so doing it by line won't work.

Here is the XML file, "Commands.xml" (simplified slightly)
<?xml Versionsion="1.0" standalone="yes"?>

I'm trying to put the value of "Run" from the XML into a variable, "Run" (I know, I'm super creative) in my batch file then check the variable in a later step.

Any help would be greatly appreciated, because I already know this isn't an easy thing to do!

See More: Write to XML Tag

Report •

August 29, 2010 at 09:26:13
I should add that I can READ from this tag successfully with the following:

FOR /F "delims=<*> tokens=2" %%a IN ('FINDSTR /B "<Run>" Commands.xml') DO SET Run=%%a

So the only part I'm still confused about is to write to that same line. Even if I have to write the whole line as: <Run>Stop</Run> instead of just the word "Stop" would be fine with me.

Report •

September 2, 2010 at 06:21:18
I'm beginning to think this is not possible with an existing file...

Report •

September 2, 2010 at 07:50:50
there's no reason why anyone would restrict the use of tools that makes your job easier. Programming languages like Python/vb etc increase workplace productivity. You should tell your boss that if he/she doesn't know

GNU win32 packages | Gawk

Report •

Related Solutions

September 2, 2010 at 08:57:37
It's mostly because we can't / don't want to redistribute to our customers after this works.

Report •

Ask Question