IdleSettings (settingsType) Element

Specifies how the Task Scheduler performs tasks when the computer is in an idle state. For information about idle conditions, see Task Idle Conditions.

<xs:element name="IdleSettings"
    type="idleSettingsType"
    minOccurs="0"
 />

The IdleSettings element is defined by the settingsType complex type.

Parent element

Element Derived from Description
Settings settingsType Contains the settings that the Task Scheduler uses to perform the task.

Child elements

Element Type Description
Duration duration Specifies how long the computer must be in an idle state before the task is run.
RestartOnIdle boolean Specifies whether the task is restarted when the computer cycles into an idle condition more than once.
StopOnIdleEnd boolean Specifies that the Task Scheduler will stop the task if the idle condition ends before the task is completed.
WaitTimeout duration Specifies the amount of time that the Task Scheduler will wait for an idle condition to occur.

Remarks

For script development, idle settings are specified using the TaskSettings.IdleSettings property.

For C++ development, idle settings are specified using the ITaskSettings::IdleSettings property.

Examples

The following XML defines a settings element that allows Task Scheduler to wait 24 hours for an idle condition and then allows only 10 minutes {IdleDuration) to initiate the task.

<Settings>
    <IdleSettings>
        <WaitTimeout>PT24H</WaitTimeout>
        <Duration>PT5M</Duration>
        <TerminateOnIdleEnd>false</TerminateOnIdleEnd>
        <RestartOnIdle>false</RestartOnIdle> 
    </IdleSettings>       
</Settings>

Requirements

Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]

See also

Task Scheduler Schema Elements

Task Scheduler