Total Pageviews

Tuesday, 20 December 2011

用批处理文件修改IP、DNS

红色部分根据自己需要修改,手动修改IP、DNS
cmd /c netsh interface ip set address name="本地连接" source=static addr=192.168.1.100 mask=255.255.255.0 gateway=192.168.1.1 gwmetric=1
cmd /c netsh interface ip set dns name="本地连接" source=static addr=208.67.222.222
cmd /c netsh interface ip add dns name="本地连接" addr=8.8.8.8 index=2

修改为DHCP自动获取
netsh interface ip set address name="本地连接" source=dhcp
netsh interface ip delete dns "本地连接" all

No comments:

Post a Comment