strIPAddress=Array("10.1.1.1")
strSubnetMask=Array("255.0.0.0")
strComputer="."
Set objWMIService=GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters=objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each objNetAdapter in colNetAdapters
'设置IP和子网掩码
errEnable=objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
Next