Редагувати

Поділитися через


RepetitionPattern object

Scripting object that defines how often the task is run and how long the repetition pattern is repeated after the task is started.

Members

The RepetitionPattern object has these types of members:

Properties

The RepetitionPattern object has these properties.

Property Access type Description
Duration
Read/write
Gets or sets how long the pattern is repeated.
Interval
Read/write
Gets or sets the amount of time between each restart of the task.
StopAtDurationEnd
Read/write
Gets or sets a Boolean value that indicates if a running instance of the task is stopped at the end of the repetition pattern duration.

Remarks

If you specify a repetition duration for a task, you must also specify the repetition interval.

If you register a task that contains a trigger with a repetition interval equal to one minute and a repetition duration equal to four minutes, the task will be launched five times. The five repetitions can be defined by the following pattern.

  1. A task starts at the beginning of the first minute.
  2. The next task starts at the end of the first minute.
  3. The next task starts at the end of the second minute.
  4. The next task starts at the end of the third minute.
  5. The next task starts at the end of the fourth minute.

Windows Server 2003, Windows XP and Windows 2000: If you register a task that contains a trigger with a repetition interval equal to one minute and a repetition duration equal to four minutes, the task will be launched four times.

When reading or writing XML for a task, the repetition pattern is specified using the Repetition element of the Task Scheduler schema.

Examples

For more information and example code for this property, see Daily Trigger Example (Scripting).

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Type library
Taskschd.tlb
DLL
Taskschd.dll

See also

Task Scheduler Objects

Task Scheduler