ITaskFolder::GetTasks method (taskschd.h)

Gets all the tasks in the folder.


  [in]  LONG                      flags,
  [out] IRegisteredTaskCollection **ppTasks


[in] flags

Specifies whether to retrieve hidden tasks. Pass in TASK_ENUM_HIDDEN to retrieve all tasks in the folder including hidden tasks, and pass in 0 to retrieve all the tasks in the folder excluding the hidden tasks.

[out] ppTasks

An IRegisteredTaskCollection collection of all the tasks in the folder.

Pass in a reference to a NULL IRegisteredTaskCollection interface pointer. Referencing a non-NULL pointer can cause a memory leak because the pointer will be overwritten.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header taskschd.h
Library Taskschd.lib
DLL Taskschd.dll

See also


Task Scheduler