ITaskSettings interface (taskschd.h)

Provides the settings that the Task Scheduler service uses to perform the task.

Inheritance

The ITaskSettings interface inherits from the IDispatch interface.

Methods

The ITaskSettings interface has these methods.

 
ITaskSettings::get_AllowDemandStart

Gets or sets a Boolean value that indicates that the task can be started by using either the Run command or the Context menu. (Get)
ITaskSettings::get_AllowHardTerminate

Gets or sets a Boolean value that indicates that the task may be terminated by the Task Scheduler service using TerminateProcess. (Get)
ITaskSettings::get_Compatibility

Gets or sets an integer value that indicates which version of Task Scheduler a task is compatible with. (Get)
ITaskSettings::get_DeleteExpiredTaskAfter

Gets or sets the amount of time that the Task Scheduler will wait before deleting the task after it expires. (Get)
ITaskSettings::get_DisallowStartIfOnBatteries

Gets or sets a Boolean value that indicates that the task will not be started if the computer is running on batteries. (Get)
ITaskSettings::get_Enabled

Gets or sets a Boolean value that indicates that the task is enabled. The task can be performed only when this setting is True.
ITaskSettings::get_ExecutionTimeLimit

Gets or sets the amount of time that is allowed to complete the task. (Get)
ITaskSettings::get_Hidden

Gets or sets a Boolean value that indicates that the task will not be visible in the UI. (Get)
ITaskSettings::get_IdleSettings

Gets or sets the information that specifies how the Task Scheduler performs tasks when the computer is in an idle condition. (Get)
ITaskSettings::get_MultipleInstances

Gets or sets the policy that defines how the Task Scheduler deals with multiple instances of the task. (Get)
ITaskSettings::get_NetworkSettings

Gets or sets the network settings object that contains a network profile identifier and name. (Get)
ITaskSettings::get_Priority

Gets or sets the priority level of the task. (Get)
ITaskSettings::get_RestartCount

Gets or sets the number of times that the Task Scheduler will attempt to restart the task. (Get)
ITaskSettings::get_RestartInterval

Gets or sets a value that specifies how long the Task Scheduler will attempt to restart the task. (Get)
ITaskSettings::get_RunOnlyIfIdle

Gets or sets a Boolean value that indicates that the Task Scheduler will run the task only if the computer is in an idle condition. (Get)
ITaskSettings::get_RunOnlyIfNetworkAvailable

Gets or sets a Boolean value that indicates that the Task Scheduler will run the task only when a network is available. (Get)
ITaskSettings::get_StartWhenAvailable

Gets or sets a Boolean value that indicates that the Task Scheduler can start the task at any time after its scheduled time has passed. (Get)
ITaskSettings::get_StopIfGoingOnBatteries

Gets or sets a Boolean value that indicates that the task will be stopped if the computer is going onto batteries. (Get)
ITaskSettings::get_WakeToRun

Gets or sets a Boolean value that indicates that the Task Scheduler will wake the computer when it is time to run the task, and keep the computer awake until the task is completed. (Get)
ITaskSettings::get_XmlText

Gets or sets an XML-formatted definition of the task settings. (Get)
ITaskSettings::put_AllowDemandStart

Gets or sets a Boolean value that indicates that the task can be started by using either the Run command or the Context menu. (Put)
ITaskSettings::put_AllowHardTerminate

Gets or sets a Boolean value that indicates that the task may be terminated by the Task Scheduler service using TerminateProcess. (Put)
ITaskSettings::put_Compatibility

Gets or sets an integer value that indicates which version of Task Scheduler a task is compatible with. (Put)
ITaskSettings::put_DeleteExpiredTaskAfter

Gets or sets the amount of time that the Task Scheduler will wait before deleting the task after it expires. (Put)
ITaskSettings::put_DisallowStartIfOnBatteries

Gets or sets a Boolean value that indicates that the task will not be started if the computer is running on batteries. (Put)
ITaskSettings::put_ExecutionTimeLimit

Gets or sets the amount of time that is allowed to complete the task. (Put)
ITaskSettings::put_Hidden

Gets or sets a Boolean value that indicates that the task will not be visible in the UI. (Put)
ITaskSettings::put_IdleSettings

Gets or sets the information that specifies how the Task Scheduler performs tasks when the computer is in an idle condition. (Put)
ITaskSettings::put_MultipleInstances

Gets or sets the policy that defines how the Task Scheduler deals with multiple instances of the task. (Put)
ITaskSettings::put_NetworkSettings

Gets or sets the network settings object that contains a network profile identifier and name. (Put)
ITaskSettings::put_Priority

Gets or sets the priority level of the task. (Put)
ITaskSettings::put_RestartCount

Gets or sets the number of times that the Task Scheduler will attempt to restart the task. (Put)
ITaskSettings::put_RestartInterval

Gets or sets a value that specifies how long the Task Scheduler will attempt to restart the task. (Put)
ITaskSettings::put_RunOnlyIfIdle

Gets or sets a Boolean value that indicates that the Task Scheduler will run the task only if the computer is in an idle condition. (Put)
ITaskSettings::put_RunOnlyIfNetworkAvailable

Gets or sets a Boolean value that indicates that the Task Scheduler will run the task only when a network is available. (Put)
ITaskSettings::put_StartWhenAvailable

Gets or sets a Boolean value that indicates that the Task Scheduler can start the task at any time after its scheduled time has passed. (Put)
ITaskSettings::put_StopIfGoingOnBatteries

Gets or sets a Boolean value that indicates that the task will be stopped if the computer is going onto batteries. (Put)
ITaskSettings::put_WakeToRun

Gets or sets a Boolean value that indicates that the Task Scheduler will wake the computer when it is time to run the task, and keep the computer awake until the task is completed. (Put)
ITaskSettings::put_XmlText

Gets or sets an XML-formatted definition of the task settings. (Put)

Remarks

By default, a task will be stopped 72 hours after it starts to run. You can change this by changing the ExecutionTimeLimit setting.

When reading or writing XML for a task, the task settings are defined in the Settings element of the Task Scheduler schema.

When battery saver is on, Windows Task Scheduler tasks are triggered only if the task is:

  • Not set to Start the task only if the computer is idle... (task doesn't use IdleSettings)
  • Not set to run during automatic maintenance (task doesn't use MaintenanceSettings)
  • Is set to Run only when user is logged on (task LogonType is TASK_LOGON_INTERACTIVE_TOKEN or TASK_LOGON_GROUP)
All other triggers are delayed until battery saver is off. For more information about accessing battery saver status in your application, see SYSTEM_POWER_STATUS. For general information about battery saver, see battery saver (in the hardware component guidelines).

Examples

For more information and a code example for this interface, see Time Trigger Example (C++).

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header taskschd.h

See also

IIdleSettings

INetworkSettings

ITaskDefinition