将下面的代码保存为 .VBS 文件
————————-
'设置IP
strIPAddress=Array("192.168.11.178")
'设置子网掩码
strSubnetMask=Array("255.255.255.0")
'设置网关
DefaultIPGateway=Array("192.168.11.1")
'设置跃点数
GatewayCostMetric=Array("1")
'设置DNS服务器
DNSServer = Array("211.162.62.2", "211.155.23.88")
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)
'设置网关和跃点数
errEnable=objNetAdapter.SetGateways(DefaultIPGateway,GatewayCostMetric)
'设置DNS
errEnable=objNetAdapter.SetDNSServerSearchOrder(DNSServer)
Next
——————
然后直接点击运行就可以修改本地IP
先添加Microsoft Loopback Adapter虚拟网卡,再把其IP和网关都设为1.1.1.1,掩码为255.255.255.0试试
172.0.0.1还是127.0.0.1啊?