@ECHO OFF
:CHECK
TASKLIST /NH /FI "IMAGENAME EQ CALC.EXE" /FI "STATUS EQ RUNNING" | FIND /I ":" > NUL
IF %ERRORLEVEL%==0 GOTO NOT_RUNNING
TIMEOUT /T 300 /NOBREAK
GOTO CHECK
:NOT_RUNNING
TASKKILL /IM CALC.EXE /T /F
START CALC.EXE
TIMEOUT /T 10 /NOBREAK
GOTO CHECK