My goal is to use this batch file to constantly check if the two python scripts are running. If any one of the script is not, it will run it. Is there a way to check this in a batch file? I tried:
SET pid_1=TASKLIST|find /i "..script1.py"
echo %pid_1%
SET pid_2=TASKLIST|find /i "..script1.py"
echo %pid_2%
It didn't work.
Do I have to add a function in both of the scripts to write their pid in a file and then let the batch file check if the process exist? Like this: Check to see if python script is running