Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


vbs check an xml sheet for data

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,59908
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> vbs check an xml sheet for data
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 vbs check an xml sheet for data - 5/7/2008 1:13:41 AM   
  davidv

 

Posts: 3
Score: 0
Joined: 5/4/2008
Status: offline
hi all

my first post on this board, which really means i'm a newbie :)

im working on a vbscript to add printers to a pc with the same default gateway
the data is in a xml form
smth like this :

  <QryDefGate>
'<DEFAULT_GATEWAY>10.201.2.1</DEFAULT_GATEWAY>
'<PC>T20DXPHAS02</PC>
'<PRINTER>T20PR005</PRINTER>
'<DEFAULT>1</DEFAULT>
'</QryDefGate>
now i wanna check the file when i have the default gateway and pcname and display me the printer or printers
so smth like this i thought:
Set NodeList = objXMLDoc.documentElement.selectNodes("//QryTst[DEFAULT_GATEWAY='" & (strDefGate)] & "' [PC='" & UCase(strWSName) & "']/PRINTER")

i searched the internet on how to select multiple fields but cant find it


can somebody help me out or atleast tell me where i can find smth about this

you would help me out a lot !!!


thx in advance
 
 
Post #: 1
 
 RE: vbs check an xml sheet for data - 5/7/2008 3:32:35 AM   
  dm_4ever


Posts: 1941
Score: 30
Joined: 6/29/2006
From: Orange County, California
Status: offline
Is the XML file like this?

<QryDefGate>
...data
</QryDefGate>

<QryDefGate>
...data
</QryDefGate>

<QryDefGate>
...data
</QryDefGate>

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to davidv)
 
 
Post #: 2
 
 RE: vbs check an xml sheet for data - 5/7/2008 3:55:57 PM   
  davidv

 

Posts: 3
Score: 0
Joined: 5/4/2008
Status: offline
hi dm_4ever

yeah the xml form is like that, sorry if my question wasnt completely clear

<QryDefGate>
'<DEFAULT_GATEWAY>10.201.2.1</DEFAULT_GATEWAY>
'<PC>T20DXPHAS02</PC>
'<PRINTER>T20PR005</PRINTER>
'<DEFAULT>1</DEFAULT>
'</QryDefGate>

describing each computer with his default gateway and printer it has connected.
the default printer has a 1 in the default field if it just has the same default gateway the value is 0.


thx for replying

< Message edited by davidv -- 5/7/2008 4:04:02 PM >

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: vbs check an xml sheet for data - 5/7/2008 4:04:37 PM   
  dm_4ever


Posts: 1941
Score: 30
Joined: 6/29/2006
From: Orange County, California
Status: offline
You might try....

"//QryDefGate[DEFAULT_GATEWAY='" & strDefGate & "' and PC='" & UCase(strWSName) & "']/PRINTER"

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to davidv)
 
 
Post #: 4
 
 RE: vbs check an xml sheet for data - 5/8/2008 5:57:19 PM   
  davidv

 

Posts: 3
Score: 0
Joined: 5/4/2008
Status: offline
Thx dm_4ever

this really helped me out !!!!!


(in reply to dm_4ever)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> vbs check an xml sheet for data Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts