I have a scheduled task that runs a batch file, and even though I can see the results of it completing successfully, according to the task scheduler it fails with error 0xff, every time.
I have other batch files scheduled that also complete successfully and return 0x0 as they should. The only difference I can see between these files is that the working ones end with:
IF ERRORLEVEL 1 (
("notify me" script here)
)
whereas the broken one ends with:
IF %2==something (
(run a program here)
IF ERRORLEVEL 1 (
(same "notify me" script here)
)
)
Does an IF block return 0xff if false or something? What's the deal?