Task Scheduler Log Exit Code

  • Thread starter Thread starter Ken Hyde
  • Start date Start date
The exit code is generated by the application that
you got the Task Scheduler to run. You must therefore
look at the application, not the task scheduler.
 
-----Original Message-----
The exit code is generated by the application that
you got the Task Scheduler to run. You must therefore
look at the application, not the task scheduler.




Thanks for the quick reply. Unfortunately, I was only
trying to schedule a batch file to run. The batch file
invokes the net use command to map a drive. The batch
file runs on its own but not through the Task Scheduler.
If I review the Task Scheduler log, I see Result: The
task completed with an exit code of (2). Any other ideas?
 
Ken Hyde said:
trying to schedule a batch file to run. The batch file
invokes the net use command to map a drive. The batch
file runs on its own but not through the Task Scheduler.
If I review the Task Scheduler log, I see Result: The
task completed with an exit code of (2). Any other ideas?

This means that some command(s) inside the batch
file returned a non-zero error code. Add some simple
diagnostics and you will see what they are:

@echo off
echo %date% %time%: Start of test > c:\test.log
xcopy . . . . . 1>>c:\test.log 2> c:\test.err
echo %date% %time%: End of test >> c:\test.log

Now have a look at the two log files.
 
Back
Top