Thursday, April 14, 2016

Task Scheduler With Non-Zero Return Code

I get this solution from Win 2008 Task Scheduler With Return Code 1 (0X1)

It has been many hours very frustrated as to why my console app works fine running interactively but not when it runs in Window Task Scheduler.

I got this in the history for the task '...action "C:\Windows\SYSTEM32\cmd.exe" with return code 2147942401'

The solution was to do as the article above directs. Do NOT put the full file path in the program/script textbox. Instead put only the name of the bat file there. Put the path to the bat file in the Start in (Optional) field.