Windows Server - Task Scheduler Exit Code

Asked By GMC on 20-Apr-07 08:36 PM
Windows Server 2003

Hello all,

Where can I find the meaning of the task scheduler exit codes?  I have exit
codes of 0,1,2 and 3, but cannot find a description of the meaning.

Thanks,

GMC




Herb Martin replied on 20-Apr-07 08:53 PM
Specifically where are you getting these codes?  From SchTasks.exe?

Somewhere else?


--
Herb Martin, MCSE, MVP
http://www.LearnQuick.Com
(phone on web site)
GMC replied on 20-Apr-07 09:00 PM
I go to scheduled tasks and then click on the Advanced tab and then click
view log and it says: " The task completed with an exit code of (0) or (1)
or (2) or (3) or (4).

Or I can just look at the scheduled tasks and in the results column it says
0x1 or 0x2 or 0x3 or 0x4.

gmc
Pegasus \(MVP\) replied on 20-Apr-07 09:53 PM
exit

Task Scheduler exit codes are generated by the applications
you run under the Scheduler, not by the scheduler itself. Redirect
the standard & error output of these applications to a log file
to see what's going on.
Herb Martin replied on 20-Apr-07 10:21 PM
Redirecting both is fairly trick, even order dependent:

task 1>t.txt 2>&1

The 2 or StdError must come SECOND on the command line whether
this seems to make sense or not.