The NetScheduleJobDel function deletes a range of jobs queued to run at a computer. This function requires that the Schedule service be started at the computer to which the job deletion request is being sent.
Only members of the Administrators local group can successfully execute NetScheduleJobDel on a remote server.
NET_API_STATUS NetScheduleJobDel(
LPWSTR Servername, | |
DWORD MinJobId, | |
DWORD MaxJobId | |
); |
This function deletes all jobs whose job identifier is in the range MinJobId through MaxJobId. To delete all jobs at the server, you can call this function with MinJobId equal to 0 and MaxJobId equal to (DWORD) - 1. To delete just one particular job, you can choose MinJobId and MaxJobId both equal to the identifier for that job.