改IP亲测可行,加了后面恢复IP自动,并运行后,改IP失效了...
Call 改Ip地址("192.168.1.123","255.255.255.0","192.168.1.1")
Sub 改Ip地址(新IP地址,新子网掩码,新网关)
Call Plugin.File.WriteFileEx(".\ChgIP.bat", "netsh interface ip set address name=""本地连接"" source = static addr = " & 新IP地址 &"mask=" & 新子网掩码 &" "&vbcrlf&"netsh interface ip set address name=""本地连接"" gateway = "& 新网关 &" gwmetric =0")
Delay 2000
RunApp ".\ChgIP.bat"
Delay 200
Call Plugin.File.DeleteFile(".\ChgIP.bat")
End Sub
Call 恢复Ip地址自动()
Sub 恢复Ip地址自动()
Call Plugin.File.WriteFileEx(".\ChgIP.bat", "netsh interface ip set address name=""本地连接"" source = DHCP" &"netsh interface ip set dns name=""本地连接"" source = DHCP")
Delay 2000
RunApp ".\ChgIP.bat"
Delay 200
Call Plugin.File.DeleteFile(".\ChgIP.bat")
End Sub