wmi problem

Author Message
robszar

  • Total Posts : 193
  • Scores: 0
  • Reward points : 0
  • Joined: 2/27/2005
  • Location:
  • Status: offline
wmi problem Wednesday, October 10, 2007 6:10 AM (permalink)
0
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")
%>






 
#1
    dm_4ever

    • Total Posts : 3687
    • Scores: 82
    • Reward points : 0
    • Joined: 6/29/2006
    • Location: Orange County, California
    • Status: offline
    RE: wmi problem Wednesday, October 10, 2007 11:28 AM (permalink)
    0
    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
     
    #2
      robszar

      • Total Posts : 193
      • Scores: 0
      • Reward points : 0
      • Joined: 2/27/2005
      • Location:
      • Status: offline
      RE: wmi problem Thursday, October 11, 2007 12:07 AM (permalink)
      0
      Thanks.  my bad, should of caught that...
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • 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
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9