@echo off
TITLE 网络检测
time /T > ping.txt
ping www.baidu.com -n 1 >> ping.txt
findstr /n "主机" ping.txt
if %errorlevel%==0 (
rem 网卡重启
netsh interface set interface "以太网" disabled
netsh interface set interface "以太网" enabled
)else (
echo "网络无异常"
)
@echo on
标签:windows,重启,ping,echo,网卡,interface,txt,以太网
From: https://www.cnblogs.com/liudianer/p/17768872.html