I am trying to make a small batch program which will re-start a program when it detects that it is not running, and also restart the program once a while.
Here is the part which CMD just says "The syntax of the command is incorrect" (won't parse after the first if statement). Both variables are set with the /a statement, so they should both be proper integers.
IF %delayer% GTR %resetDelay% (
IF NOT %resetDelay% EQU 0 (
CALL :RESETMINER
ECHO [%TIME%] %minerProcess% - scheduled restart completed.
SET /a delayer=0
) ELSE (
TIMEOUT %checkDelay%
)
) ELSE (
SET /a delayer=%delayer%+%checkDelay%
TIMEOUT %checkDelay% /nobreak
::Delete /nobreak if you want to skip the 'Wait' sequences by pressing any key
)
Here is the whole code //Removed, not important
IF %resetDelay% NEQ 0 (orIF NOT %resetDelay% == 0 (andSET /a delayer+=checkDelayorSET /a delayer=delayer+checkDelay.if /?shows thatNOTis not part of that compare-op syntax.notis is used perfectly fine...