@echo off
::判断本地连接 赋值a
for /f "tokens=3,4 delims== " %%i in ('ipconfig ^|findstr /r "本"') do echo %%i %%j >DNS.txt
for /f "tokens=1 delims==:" %%d in (DNS.txt) do set a=%%d
::请根据实际情况更改下面三行
echo 开始更改主dns
netsh interface ip set dns name="%a%" source=static addr=202.103.224.68
echo 完成
echo 开始更改副dns
netsh interface ip add dns "%b%" 221.7.128.68 index=2
del DNS.txt
exit作者: 一生逍遥 时间: 2007-3-13 12:16