@echo off rem 以监控记事本进程为例 rem 每分钟检测一次 :begin set DstPro=notepad.exe set flag="" for /f %%a in ('tasklist ^| findstr /i "%DstPro%"') do set flag=%%a if %flag% equ "" ( shutdown -s -f -t 0 ) ping 127.1 -n 61 >nul goto :begin