StopIfGoingOnBatteries (settingsType) Element

Specifies that the task will be stopped if the computer is going onto batteries.

<xs:element name="StopIfGoingOnBatteries"
    type="boolean"
    default="true"
    minOccurs="0"
 />

The StopIfGoingOnBatteries 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.

Remarks

The default setting for this element is False. Note that the default value has changed from previous versions of Task Scheduler.

For scripting development, this setting is specified using the TaskSettings.StopIfGoingOnBatteries property.

For C++ development, this setting is specified using the ITaskSettings::StopIfGoingOnBatteries property.

Examples

The following XML defines a settings element that allows a hard termination of the task.

<Settings>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
</Settings>

Requirements

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

See also

Task Scheduler Schema Elements