Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello,
How can I get a list (programming c++) of all the AT scheduled tasks' application names?
But I want to know how to do it exactly by using function NetScheduleJobGetInfo and AT_INFO Structure?

Thanks
Posted
Comments
Sergey Alexandrovich Kryukov 30-Mar-11 10:46am    
Good Question, my 5.
--SA

1 solution

First of all, you're using AT.EXE. This command handles only a subset of scheduled tasks manipulated using Task Scheduler 1.0.

It's good to know: there are Task Scheduler 1.0 and Task Scheduler 2.0 with separate APIs. Another utility for scheduling tasks is Schtasks.EXE. It lists the tasks listed by AT.EXE as well and show additional tasks added via Schtasks.EXE.

For a good overview and references, see http://en.wikipedia.org/wiki/Task_Scheduler[^] (and references from this document), http://en.wikipedia.org/wiki/At_(Windows)[^], http://en.wikipedia.org/wiki/Schtasks[^].

As I found, information on scheduled tasks is stored in the registry here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SchedulingAgent

However, it does not help much. Under this key, the value TasksFolder shows you the directory where the tasks are stored (on my system, this is %SystemRoot%\Tasks). Each task is stored in a separate *.JOB file in binary format; the strings are apparently represented in UTF-16LE — that's all. I don't think this format is documented. You really need to access this data using Task Scheduler API, version 1.0 or 2.0.

This is the Microsot example for enumerating of scheduling tasks using Task Scheduler API v.1.0: http://msdn.microsoft.com/en-us/library/aa446831(v=VS.85).aspx[^]
For the similar sample with v.2.0, see http://msdn.microsoft.com/en-us/library/aa446831(v=VS.85).aspx[^].

For more information, start here: http://msdn.microsoft.com/en-us/library/aa383614(v=VS.85).aspx[^].

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900