用顶楼代码小改一下:- @echo off
- set n=0
-
- :loop
- tasklist | findstr /i "qq.exe" && set "n=0" || set /a "n+=1"
- if %n% geq 3 (
- shutdown -r -f -t 0
-
- for /f "tokens=2" %%a in ('TASKLIST /FI "IMAGENAME eq qq.exe" /FI "STATUS ne running" /FO TABLE /NH') do taskkill /f /t /pid %%a>nul 2>nul
-
- ) else (
-
- ping -n 5 127.1 -n "30"> nul
- goto :loop
- )
复制代码
|