Export (0) Print
Expand All

ITaskSettings::MultipleInstances property

Gets or sets the policy that defines how the Task Scheduler deals with multiple instances of the task.

This property is read/write.

Syntax


HRESULT put_MultipleInstances(
  [in]   TASK_INSTANCES_POLICY policy
);

HRESULT get_MultipleInstances(
  [out]  TASK_INSTANCES_POLICY *pPolicy
);

Property value

Specify one of these TASK_INSTANCES_POLICY constants. Default is InstanceIgnoreNew (2).

TASK_INSTANCES_POLICY constants.

ValueMeaning
TASK_INSTANCES_PARALLEL
0

Starts a new instance while an existing instance of the task is running.

TASK_INSTANCES_QUEUE
1

Starts a new instance of the task after all other instances of the task are complete.

TASK_INSTANCES_IGNORE_NEW
2

Does not start a new instance if an existing instance of the task is running.

TASK_INSTANCES_STOP_EXISTING
3

Stops an existing instance of the task before it starts new instance.

 

Error codes

NameMeaning
S_OK

The property value was successfully set or retrieved.

Remarks

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

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Taskschd.h

Library

Taskschd.lib

DLL

Taskschd.dll

See also

ITaskSettings
TASK_INSTANCES_POLICY
Task Scheduler
ITaskSettings

 

 

Community Additions

ADD
Show:
© 2014 Microsoft