Vibe,
Johnny is correct; you should add the netshell component. Netshell will
allow you to modify any network setting. But, you can also modify you ip by
scripting your ip settings:
IpADD="192.168.0.1"
SubNet="255.255.255.0"
gat="192.168.0.3"
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery("Select * from
Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array(IpADD)
strSubnetMask = Array(SubNet)
strGateway = Array(gat)
strGatewayMetric = Array(1)
if IpADD <> "" and SubNet <> "" then
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
If errEnable = 0 Then
WScript.Echo "The IP address has been changed."
Else
WScript.Echo "The IP address could not be changed."
End If
Next
end if
WScript.Echo errEnable
end if
By the way, there are tons of WMI scripts that will allow you to manage you
system, you can find everything on TechNet: script center:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx
Regards,
Sean Gahan