strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" &
amp; strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select *
From Win32_NetworkAdapter
configuration where I
PEnabled=TRUE")
strIPAddress = Array("192.168.1.141")
strS
ubnetmask = Array("255.255.255.0")
strGateway = Array("192.168.1.100")
strGatewayMetric = Array(1)
For
each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.Enable
static(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