BAT监控程序运行

通过bat监控程序运行,实现软件异常退出后重新启动

BAT监控程序运行_第1张图片

@echo off
:begin
set Program="Bypass.exe"
tasklist -v | findstr %Program% > NUL
if ErrorLevel 1 (
echo %date%+ %time% >> log.txt
echo "not running"
d:
cd d:\Software\Tools\Bypass_1.13.92\Bypass
Bypass.exe
)
goto begin
pause

你可能感兴趣的:(Other,batch)