BAT 脚本可以用以下方式检测网络连接,如果网络连接断开,可以重新连接 WIFI:

@echo off

:check_network ping 8.8.8.8 -n 1 -w 1000 > nul if errorlevel 1 goto reconnect_wifi goto check_network

:reconnect_wifi echo Network disconnected. Reconnecting... netsh wlan connect name="your_wifi_name" > nul ping 127.0.0.1 -n 5 > nul goto check_network

替换 "your_wifi_name" 为你的 WIFI 名称。这个脚本会不断 ping 8.8.8.8,如果发现连接断开,就会自动重新连接 WIFI。

BAT 检测网络 断网重新连接WIFI

原文地址: https://www.cveoy.top/t/topic/xUb 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录