$gip = InputBox("更改ip地址", "请输入ip地址")
$IP = $gip
$gzwym = InputBox("更改的子网", "请输入子网地址,不建议修改")
$zwym = $gzwym
$gwg = InputBox("更改网关", "请输入网关")
$wg = $gwg
$gdns = InputBox("更改dns服务器", "请输入dns地址")
$dns = $gdns
$bak_dns = ""
;修改IP,dns,路由
RunWait('netsh interface ip set address name = "本地连接" source = static addr = ' & $IP & ' mask = ' & $zwym & ' gateway = ' & $wg & ' gwmetric = 0', "c:\windows\system32", @SW_HIDE)
RunWait('netsh interface ip set dns name = "本地连接" source = static addr = ' & $dns & ' register = PRIMARY', "c:\windows\system32", @SW_HIDE)
RunWait('netsh interface ip add dns name = "本地连接" addr = ' & $bak_dns & ' index=2', "c:\windows\system32", @SW_HIDE)
求指教,非常感谢。 |