IRegisteredTask::Stop method (taskschd.h)

Stops the registered task immediately.

Syntax

HRESULT Stop(
  [in] LONG flags
);

Parameters

[in] flags

Reserved. Must be zero.

Return value

This method can return one of these values.

Return code Description
S_OK
All instances of the registered task that user has permissions to stop were stopped.
S_FALSE
The user cannot successfully stop instances of the task.

Remarks

The IRegisteredTask::Stop function stops all instances of the task.

System account users can stop a task, users with Administrator group privileges can stop a task, and if a user has rights to execute and read a task, then the user can stop the task. A user can stop the task instances that are running under the same credentials as the user account. In all other cases, the user is denied access to stop the task.

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

IRegisteredTask