window监测网卡断网后自动重启网卡

@echo off
echo "网卡自动重启服务正在进行中......."
:begin
ping qq.com>ping.txt 
rem echo %errorlevel%
if %ERRORLEVEL% == 1 goto ping2
exit
 
:ping2
ping baidu.com>ping.txt 
rem echo %errorlevel%
if %ERRORLEVEL% == 1 goto reboot
exit
 
:reboot
cmd /c netsh interface set interface name="本地连接" admin=DISABLED
cmd /c netsh interface set interface name="本地连接" admin=ENABLED
赞 (0)

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址