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?
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.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.