用vb脚本改变用户的ip.网关.dns

Dim IP
Ip=Inputbox("请输入IP")
strSubnetMask=Array("255.255.255.0")
DefaultIPGateway=Array("192.168.2.253")
DNSServer=Array("61.139.2.69")
strComputer = "."  
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")  
Set colNetAdapters = objWMIService.ExecQuery _  
    ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress=Array(Ip)
For Each objNetAdapter in colNetAdapters
    errEnable=objNetAdapter.EnableStatic(strIPAddress, strSubnetMask,DefaultIPGateway,DNSServer)
Next 

你可能感兴趣的:(改变用户的ip,vb脚本)