Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old September 7th, 2004, 07:51 AM
mparker1113 mparker1113 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 254 mparker1113 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 29 m 48 sec
Reputation Power: 5
WSH: Class SWebmLocator not defiined

Hello, great ones:

I have found the below code on the web for changing an IP address via a vbs script.

However, when I run it I get an error: "Class not found SWbemLocator."

The code is below, and I know that the solution is likely not to difficult. Would someone please point out to me the error of my code?

Code:
Set oLocator = New SWbemLocator
Set oServices = oLocator.ConnectServer(, "root\cimv2")
Set oObject = oServices.Get("Win32_NetworkAdapterConfiguration.Index=0")
Dim asIPAddress
Dim asSubnetMask
asIPAddress = Array("159.105.138.47")
asSubnetMask = Array("255.255.255.0")
Set oMethod = oObject.Methods_("EnableStatic")
Set inParam = oMethod.InParameters.SpawnInstance_()
inParam.IPAddress = asIPAddress
inParam.SubnetMask = asSubnetMask
Set outParam = oObject.ExecMethod_("EnableStatic", inParam)
If outParam.returnValue = 0 Then
  MsgBox "Method Succeeded."
Else
  MsgBox "Method Failed. " & CStr(outParam.returnValue)

End If


-Mike P

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > WSH: Class SWebmLocator not defiined


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway