Here is my script to change the ip address, mash and default gateway but the
default gateway is not being changed
strComputer = "."
IPAddress = InputBox("Enter IP Address")
SubnetMask = InputBox("Enter Subnet Mask")
DefaultGateway = InputBox("Enter Default Gateway")
arrIPAddress = Array(IPAddress)
arrSubnetMask = Array(SubnetMask)
arrDefaultGateway = Array(DefaultGateway)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery("Select * from
Win32_NetworkAdapterConfiguration")
For Each objNetAdapter in colNetAdapters
errEnableStatic = objNetAdapter.EnableStatic(arrIPAddress,
arrSubnetMask, arrDefaultGateway)
Next
any idea?
Bookmarks