You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
757 B
24 lines
757 B
@REM @echo off
|
|
@REM set SCRIPT_NAME=twitter.py
|
|
@REM set SCRIPT_PATH=C:\users\wlt233\Desktop\Overflow\asset\twitter\twitter.py
|
|
@REM set CHECK_INTERVAL=30
|
|
|
|
@REM :LOOP
|
|
@REM rem 检查 Python 脚本是否正在运行
|
|
@REM wmic process where "caption='python.exe' and commandline like '%%twitter.py%%'" get commandline 2>nul | findstr /I "%SCRIPT_NAME%" >nul
|
|
@REM if %errorlevel% neq 0 (
|
|
@REM echo Script not running, starting...
|
|
@REM start "" "C:\Python39\python.exe" "%SCRIPT_PATH%"
|
|
@REM ) else (
|
|
@REM echo Script running
|
|
@REM )
|
|
|
|
@REM rem 等待 CHECK_INTERVAL 秒后再次检查
|
|
@REM timeout /T %CHECK_INTERVAL% >nul
|
|
@REM goto LOOP
|
|
|
|
|
|
:start
|
|
start /wait C:\Python39\python.exe C:\path\to\twitter\twitter.py
|
|
echo script dead... restarting
|
|
goto start |