Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


wmi problem

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> wmi problem
  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 >>
 wmi problem - 10/10/2007 5:10:43 AM   
  robszar


Posts: 173
Score: 0
Joined: 2/27/2005
From:
Status: offline
Why do I get an error with this script.    http://msdn2.microsoft.com/en-us/library/Aa389395.aspx

Error Type:
Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
/testpage.asp, line 13, column 61
& "{impersonationLevel=impersonate}!root\cimv2").ExecQuery" _
------------------------------------------------------------^

here is the part of the script having a problem

<%@ LANGUAGE="VBSCRIPT"%>
<HTML>
<HEAD>
<TITLE>WMI ASP Example:
Read Default Gateway and IP Address information </TITLE>
</HEAD>

<BODY>

<%
On Error Resume Next
set IPConfigSet = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!root\cimv2").ExecQuery" _
& "("SELECT IPAddress, DefaultIPGateway "" _
& " FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=TRUE")
%>


 
 
Post #: 1
 
 RE: wmi problem - 10/10/2007 10:28:03 AM   
  dm_4ever


Posts: 2174
Score: 32
Joined: 6/29/2006
From: Orange County, California
Status: offline
Set IPConfigSet = GetObject("winmgmts:" & _
"{impersonationLevel=impersonate}!root\cimv2").ExecQuery(_
"SELECT IPAddress, DefaultIPGateway FROM " & _
"Win32_NetworkAdapterConfiguration WHERE IPEnabled=TRUE") 

_____________________________

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 robszar)
 
 
Post #: 2
 
 RE: wmi problem - 10/10/2007 11:07:46 PM   
  robszar


Posts: 173
Score: 0
Joined: 2/27/2005
From:
Status: offline
Thanks.  my bad, should of caught that...

(in reply to dm_4ever)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> wmi problem 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