Result codes in Task Scheduler

G

Guest

Hi,
Windows Task Scheduler shows result coed
does anyone have a list of result codes and their meaning?
Thanks
 
P

Pegasus \(MVP\)

Thijs said:
Hi,
Windows Task Scheduler shows result coed
does anyone have a list of result codes and their meaning?
Thanks

Most Task Scheduler return codes are generated by the task
that you're running. Here is how you can see what they
are:

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log
c:\Tools\YourTask.exe 1>>c:\test.log 2>c:\test.err
echo ErrorLevel of c:\Tools\YourTask.exe=%ErrorLevel% >> c:\test.log
echo %date% %time% End of task >> c:\test.log

Schedule this batch file, then examine the two log files and all
will become clear!
 
G

Guest

Thanks,
This helps a lot.
still one thing is strange.
I scheduled a batchjob containing a xcopy command.
log file returns : ErrorLevel of xcopy=4
err file returns : sharing violation
Task scheduler returns : result code 0x0
i'll figure it out :)
 
G

Guest

yes, I know the file is locked.
but the result code of 0x0 implies everthing should have been correct.
but it isn't according to errorlevel-4.
 
P

Pegasus \(MVP\)

I think it's time for you to do some of your own experiments.
Maybe the Task Scheduler only shows the ErrorLevel of
the last command that was executed. I don't know the answer
but it's a no brainer to find out!
 
D

Dave Patrick

This article may help you.

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q267031

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| yes, I know the file is locked.
| but the result code of 0x0 implies everthing should have been correct.
| but it isn't according to errorlevel-4.
|
|
| "Pegasus (MVP)" wrote:
|
| > The answer is obvious: one of the files you're trying
| > to copy is locked.
| >
| >
| > | > > Thanks,
| > > This helps a lot.
| > > still one thing is strange.
| > > I scheduled a batchjob containing a xcopy command.
| > > log file returns : ErrorLevel of xcopy=4
| > > err file returns : sharing violation
| > > Task scheduler returns : result code 0x0
| > > i'll figure it out :)
| > >
| > >
| > >
| > > "Pegasus (MVP)" wrote:
| > >
| > > >
| > > > | > > > > Hi,
| > > > > Windows Task Scheduler shows result coed
| > > > > does anyone have a list of result codes and their meaning?
| > > > > Thanks
| > > >
| > > > Most Task Scheduler return codes are generated by the task
| > > > that you're running. Here is how you can see what they
| > > > are:
| > > >
| > > > @echo off
| > > > echo %date% %time% Start of task > c:\test.log
| > > > echo User=%UserName%, Path=%path% >> c:\test.log
| > > > c:\Tools\YourTask.exe 1>>c:\test.log 2>c:\test.err
| > > > echo ErrorLevel of c:\Tools\YourTask.exe=%ErrorLevel% >> c:\test.log
| > > > echo %date% %time% End of task >> c:\test.log
| > > >
| > > > Schedule this batch file, then examine the two log files and all
| > > > will become clear!
| > > >
| > > >
| > > >
| >
| >
| >
 

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.

Ask a Question

Top