We have a program that is occasionally crashing. The customer runs the program from a scheduled task. When the program is run with a certain parameter, the program runs as an interface engine, creating a file and then ftp'ing the file to another server for import by another program.
I was wondering if I might have the scheduled task instead run a batch file. The batch file would run the program and check errorlevel
as the program exits. If errorlevel
is not equal to zero, then batch file would run the program again. Does anyone see problem with my plan to use errorlevel
in a batch file?
Here's an example of the batch file:
:start
myPgm.exe intfc
if errorlevel <> 0 then start
Your IF statement is wrong. It should read
if %errorlevel% neq 0 goto start
Or your script could read
:start
myPgm.exe intfc || goto start
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With