Batch scripting for fun and profit?
I need to get a value in an xml file from a batch script. I could use cscript, or maybe grab or write an exe to parse it out for me.
But sometimes it's more fun to try and do it in the batch script. In this case the xml node is on a line by itself, which makes things a little easier... something like this:
Anyway, here's my respose to this pop quiz:
for /f "tokens=3 delims=^<^>" %%i in ('findstr -i "ChangeNum" test.xml') do echo %%i
I feel a little dirty. This is fragile and hard to read. But at least I get some batchgeek points?