Microsoft KB Archive/267031

= Result Codes in Scheduled Tasks Indicate an Error Occurred in the Task =

PSS ID Number: 267031

Article Last Modified on 9/19/2003

-

The information in this article applies to:


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional

-



This article was previously published under Q267031





SUMMARY
Scheduled Tasks has its own error handling facility used for errors that are generated while scheduling a job, activating an existing scheduled job, or modifying the properties of an existing job. If errors occur internally to the job, the job closes normally and an error message is received. Result Codes indicate errors found internally in the task or job.



MORE INFORMATION
Scheduled Tasks logs the Result Code in the %systemroot%\schedlgu.txt file. To view the Result Code, follow these steps:
 * 1) Open the Scheduled Tasks window.
 * 2) On the toolbar, click Advanced/View Log.

The following Result Code is displayed:

Result: The task completed with an exit code of (xx).

Where (xx) is the result of the Get Last Error function call.

The following two examples demonstrate the Result Code:

&quot;Job1.job&quot; (testme.bat)

Finished 4/26/2000 2:10:00 PM

Result: The task completed with an exit code of (1).

&quot;Job2.job&quot; (testme2.bat)

Finished 4/26/2000 2:14:01 PM

Result: The task completed with an excode of (100a518).

The job is completed successfully, but in many cases the internal tasks of the job are not completed successfully.

When there is an error running the job, you receive the following:

&quot;badjob.job&quot; (causesanerror.bat) 6/29/2000 10:47:00 AM ** ERROR **

Unable to start task.

The specific error is:

0x80070002: The system cannot find the file specified.

Try using the Task page Browse button to locate the application.

The most common completion codes and their meanings are listed below:
 * For code 0 or 0x0: The operation completed successfully.
 * For code 1 or 0x1: Incorrect function called or unknown function called.
 * For code 10 or 0xa: The environment is incorrect.
 * For code 0x8009000f: General Access denied

If the Result Code has the format &quot;C0000XXX&quot; then the task did not complete successfully. The &quot;C&quot; indicates an error condition. The following is the most common error code received:

For code 0xC000013A: The application terminated as a result of a CTRL+C.

Result Codes and Error Conditions are defined in Ntstatus.h or Winerror.h. These files are available on the MSDN Web site or through MSDN subscription. Because these are commonly used files, a search with the search engine is not likely to produce any useful result. You may have to search the MSDN CD for the file names. If you want to download the files, download the current Windows 2000 Driver Development Kit (DDK). To download the DDK, visit one of the following Microsoft Web sites:

http://www.microsoft.com/ddk

http://www.microsoft.com/ddk/installW2k.asp

Additional query words: at scheduler mstask

Keywords: kbhowto KB267031

Technology: kbwin2000AdvServ kbwin2000AdvServSearch kbwin2000Pro kbwin2000ProSearch kbwin2000Search kbwin2000Serv kbwin2000ServSearch kbWinAdvServSearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.