BUG: NetScheduleJobAdd() Function Does Not Set the Job Execution Time Correctly (276381)



The information in this article applies to:

  • the operating system: Microsoft Windows 2000

This article was previously published under Q276381

SYMPTOMS

The NetScheduleJobAdd function does not set the execution time of the job accurately on computers that are running Microsoft Windows 2000.

The NetScheduleJobAdd function takes in a pointer to an AT_INFO structure that describes the job to submit. The first parameter of the AT_INFO structure is called JobTime. JobTime is supposed to indicate the time of day at which the job is scheduled to run. This time is the local time on the computer on which the schedule service is running; it is measured from midnight, and is expressed in milliseconds.

However, when NetScheduleJobAdd sets the time for the job, it actually truncates out the seconds and the milliseconds from the mentioned time in the JobTime parameter. For example, if a job is scheduled to execute at 13 hours, 30 minutes, and 15 seconds (that is, JobTime = 48615000), the actual time at which the job is executed is 13 hours and 30 minutes. You can verify this by calling NetScheduleJobGetInfo on the specific JobId and seeing that JobTime = 48600000 in the AT_INFO buffer.

RESOLUTION

To work around this problem, schedule the time of execution of a job rounded off to the nearest minute, if possible.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

REFERENCES

  • Platform SDK documentation
  • Microsoft Developer Network (MSDN)

Modification Type:MinorLast Reviewed:2/11/2004
Keywords:kbDSWNET2003Swept kbAPI kbbug kbnetwork KB276381