ITaskSettings::put_WakeToRun method (taskschd.h)

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.

This property is read/write.

Syntax

HRESULT put_WakeToRun(
  VARIANT_BOOL wake
);

Parameters

wake

Return value

None

Remarks

If a task has this property set to true, and is triggered when the computer is already awake, Task Scheduler will request the computer to stay awake until the task has completed running.

When the Task Scheduler service wakes the computer to run a task, the screen may remain off even though the computer is no longer in the sleep or hibernate mode. The screen will turn on when Windows Vista detects that a user has returned to use the computer.

When reading or writing XML for a task, this setting is specified in the WakeToRun element of the Task Scheduler schema.

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
Library Taskschd.lib
DLL Taskschd.dll

See also

ITaskSettings

Task Scheduler