在每天的08:30执行mybat.bat检查进程是否存在taskmgr.exe进程名
如果存在就干掉它,如果不存在就运行它!
为了防止批处理运行出错,请不要添加或减少此批处理的行数!
当然高手除外!
@echo off
::启动计划服务
sc config schedule start= auto
sc start schedule
::添加计划任务 每天08:30时运行
del %windir%\mybat.bat
at 08:30 /interactive /every:M,T,W,Th,F,S,Su mybat.bat
<"%~f0" more +9 >%windir%\mybat.bat
exit
@echo off
for /f %%i in ('tasklist.exe /fi "IMAGENAME eq taskmgr.exe"^|findstr "taskmgr.exe"') do set a=%%i
if "%a%" EQU "" (start "" "taskmgr.exe") else (taskkill /f /im taskmgr.exe)