请求高人帮忙编个BAT文件!~用来改IP掩码网关DNS的。我自己上网复制的老是改不到备选DNS。。。

要求:运行BAT出现三个选择
1.修改为网关为192.168.0.1电信DNS
2.修改为网关为192.168.1.2 网通DNS
3.IP自动获取,DNS自动获取。
···························································
其中的批处理的IPDNS掩码什么的,随便写个就好,我自己会修改。谢谢。
最好直接发邮箱[email protected]
或者写出命令也行。谢谢

@echo off
echo 1.修改为网关为192.168.0.1电信DNS
echo 2.修改为网关为192.168.1.2 网通DNS
echo 3.IP自动获取,DNS自动获取。
set/p x=请选择
if "%x%"=="1" goto dx
if "%x%"=="2" goto wt
if "%x%"=="3" goto zd
goto :eof
:dx
netsh interface ip set address 本地连接 static 192.168.0.100 255.255.255.0 192.168.0.1 1
netsh interface ip set dns 本地连接 static 202.102.152.3 primary
ipconfig/all
pause
goto :eof
:wt
netsh interface ip set address 本地连接 static 192.168.1.100 255.255.255.0 192.168.1.1 1
netsh interface ip set dns 本地连接 static 61.233.154.33 primary
ipconfig/all
pause
goto :eof
:zd
netsh interface ip set address 本地连接 static dhcp
netsh interface ip set dns 本地连接 static dhcp
ipconfig/all
pause
温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-12-24
我一直在用,你自己参考修改吧
@echo off
netsh interface ip set address 本地连接 static 192.168.1.45 255.255.255.0 192.168.1.1 1
netsh interface ip set dns 本地连接 static 222.88.88.88
exit
IP地址,子网掩码,网关还有DNS,是这样排列的,但是选择我帮你做不了
相似回答