Interface nsIWinTaskSchedulerServiceType

An interface for Windows Task Scheduler 2.0. Documentation for the underlying APIs can be found at https://docs.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-start-page

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Create a new task subfolder under a given parent folder.

    Throws

    NS_ERROR_FILE_NOT_FOUND if the parent folder does not exist.

    Throws

    NS_ERROR_FILE_ALREADY_EXISTS if the subfolder already exists.

    Parameters

    • aParentFolderName: wstring

      Immediate parent for the new folder, starting with "".

    • aSubFolderName: wstring

      Name of the new folder to create.

    Returns void

  • Delete a folder.

    Throws

    NS_ERROR_FILE_NOT_FOUND if the parent folder does not exist.

    Throws

    NS_ERROR_FILE_DIR_NOT_EMPTY if the folder was not empty.

    Parameters

    • aParentFolderName: wstring

      Immediate parent of the folder to delete, starting with "".

    • aSubFolderName: wstring

      Name of the folder to delete.

    Returns void

  • Delete a task.

    Throws

    NS_ERROR_FILE_NOT_FOUND if the folder or task do not exist.

    Parameters

    • aFolderName: wstring

      Full name of the folder containing the task, starting with "".

    • aTaskName: wstring

      Name of the task to delete.

    Returns void

  • Get the registration information for a task.

    Throws

    NS_ERROR_FILE_NOT_FOUND if the folder or task do not exist.

    Returns

    Registration information for the task, as XML text.

    Parameters

    • aFolderName: wstring

      Full name of the folder containing the task, starting with "".

    • aTaskName: wstring

      Name of the task to read.

    Returns string

  • Register (create) a task from an XML definition. The task will be created so that it only runs as the current user (TASK_LOGON_INTERACTIVE_TOKEN).

    Throws

    NS_ERROR_FILE_NOT_FOUND if the folder does not exist.

    Throws

    NS_ERROR_FILE_ALREADY_EXISTS if the task already existed and aUpdateExisting is false.

    Parameters

    • aFolderName: wstring

      Full name of the folder in which to create the task, starting with "".

    • aTaskName: wstring

      Name of the task.

    • aDefinitionXML: wstring

      XML definition of the task. This is passed directly to Task Scheduler, see the schema at https://docs.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-schema

    • aUpdateExisting: boolean

      Whether to update an existing task with the same name, default false.

    Returns void

  • Validate the XML task definition with Task Scheduler without creating a task, for testing. Doesn't throw if only the final ITaskFolder::RegisterTask() fails.

    Returns

    HRESULT from ITaskFolder::RegisterTask() Success should be S_OK (0). XML validation failure could be one of SCHED_E_UNEXPECTED_NODE, SCHED_E_NAMESPACE, SCHED_E_INVALIDVALUE, SCHED_E_MISSINGNODE, SCHED_E_MALFORMEDXML, but there may be others.

    Parameters

    • aDefinitionXML: wstring

      Definition to validate.

    Returns number

Generated using TypeDoc