测试通过(WIN 2003 SP1)
@echo off
set /p op=请选择DNS号:
if 1==%op% (
netsh interface ip set dns name="本地连接" source=static addr=218.244.0.19
netsh interface ip add dns name="本地连接" addr=61.134.1.4 index=2
) else (
netsh interface ip set dns name="本地连接" source=static addr=61.134.1.4
netsh interface ip add dns name="本地连接" addr=218.244.0.19 index=2
)
下文可能对你有帮助:
http://blog.csdn.net/t0nsha/archive/2006/12/21/1451946.aspx