复制以下内容,保存为netrestart.bat文件:
ping -n 2 8.8.8.8 | find “TTL” && echo “网络正常!” || (netsh interface set interface “本地连接” disabled
ping 127.0.0.1 -n 5
netsh interface set interface “本地连接” enabled)
pause
其中:
1、“本地连接”修改为自己的网络连接名称。
2、8.8.8.8修改为合适的测试地址,如:www.163.com、1.1.1.1。
3、ping 127.0.0.1 -n 5 仅延迟用