I have obtained a VBS/WMI script, included below, which returns the error: “Class Not Defined: SWBemLocator” Code: 800A01FA. Now, I have downloaded and installed the WMI/SDK kit, and I really need a script that sets the IP address. So any help is much appreciated. TIA. Script:
Dim strWBEMClass
Dim SWbemLocator
Set oLocator = New SWbemLocator
Set oServices = oLocator.ConnectServer(, “root\cimv2”)
Set oObject = oServices.Get(“Win32_NetworkAdapterConfiguration.Index=0”)
Dim asIPAddress
Dim asSubnetMask
asIPAddress = Array(“168.108.135.65”)
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