@echo off
call :select "State" "st"
:s_one
::下一句去掉两个冒号,则显示保存的字符串
::echo%st%
echo%st%> e:\wlan_state.txt
::--- 解析命令输出通用函数 ---
:select
for /f "tokens=2 delims=:" %%i in ('netsh wlan show interfaces ^| findstr /i /c:%1') do if not "!%~2!" == "" set "%~2=%%i"
findstr "connected" "e:\wlan_state.txt"&&goto 1||goto 2
:1
echo e:\wlan_state
goto fff
:2
::数字为N秒后重启
shutdown -r -t 30
:fff
::数字为N秒检查一次
timeout /t 600 /nobreak
goto s_one
阅读(1334) | 评论(0) | 转发(0) |