|
给个简单的例子:
@echo on
echo 设置IP地址......
echo -----------------------
@rem 关闭动态IP服务
net stop dhcp
rundll32 netshell.dll HrRenameConnection
@rem 使用接口IP上下文
netsh add helper ifmon.dll
@rem -----------------------
@rem 设置静态IP,网关,默认DNS服务器,可自行修改。
netsh interface ip set address "本地连接" static addr=10.156.31.202 mask=255.255.255.0 gateway=10.156.31.254 auto
netsh interface ip set dns "本地连接" static 172.168.1.2
netsh interface ip add dns "本地连接" 211.91.33.193
@rem 重复一次
netsh interface ip set address "本地连接" static addr=10.156.31.202 mask=255.255.255.0 gateway=10.156.31.254 auto
netsh interface ip set dns "本地连接" static 172.168.1.2
netsh interface ip add dns "本地连接" 211.91.33.193
net start dhcp
注意:必须要有netsh.exe、netshell.dll、ifmon.dll三个文件。 |
|