@echo off
netsh interface ip set address name="本地连接" source=dhcp
ipconfig /flushdns
手动分配.bat:
@echo off
netsh interface ip delete dns "本地连接" addr=all
netsh interface ip add dns "本地连接" addr=202.97.224.69
netsh interface ip add dns "本地连接" addr=202.97.224.68
netsh interface ip add address "本地连接" 192.168.1.133 255.255.255.0
netsh interface ip add address "本地连接" gateway=192.168.1.1 gwmetric=2
ipconfig /flushdns
注:使用时复制上面的代码保存为bat文件,并更改其中的网络连接为你要修改的网卡名称(如:本地连接2 根据自身情况处理),IP和DNS修改为您自己的就OK了!