@echo off
:run
(tasklist | find /i "python.exe" && echo "running") || (echo "运行run.bat" && start cmd /c run.bat)
timeout 3
goto run
然后运行这个批处理,它自动检测进程是否运行,若不运行,则自动启动,每3秒检测一次。
@echo off
:run
(tasklist | find /i "python.exe" && echo "running") || (echo "运行run.bat" && start cmd /c run.bat)
timeout 3
goto run
然后运行这个批处理,它自动检测进程是否运行,若不运行,则自动启动,每3秒检测一次。