Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script help

Status
Not open for further replies.

bilbonvidia

Technical User
Feb 6, 2007
131
GB
Hi I need a script but can only write basic dos batch files.

I need to to look at a xml file locally say c:\folder\file.xml

read the client version number from the content of the file for channel a1 and a2

" <?xml version="1.0" ?>
- <ContentStatus xmlns:xsd=" xmlns:xsi=" Overall="Unknown" LastUpdate="2007-09-25T15:58:22.9966324+01:00">
<Subscription Id="2" Status="Unknown" Name="a1 Channel" ServerVersion="Unknown" ClientVersion="1" />
<Subscription Id="8" Status="Unknown" Name="a2 Channel" ServerVersion="Unknown" ClientVersion="2" />
</ContentStatus>"

then depending on the client version copy some files from a server where x is greater than the client version.

\\server\updates\
hello-2-x-a1_Channel.txt
hello-2-x-a1_Channel.txt
hello-2-x-a1_Channel.txt
hello-2-x-a2_Channel.txt
hello-2-x-a2_Channel.txt
hello-2-x-a2_Channel.txt

So for the xml file above only files hello-1-2-a1_Channel.txt and above would get copied and hello-2-3-a2_Channel.txt and above.

These files would get copied to c:\destination and not overwrite existing files of the same name.

Does that make sense?
 
Have a look for microsoft.xmlhttp or msxml. You can use that to read the xml and extract the fields.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top