RepetitionPattern.Duration property

For scripting, gets or sets how long the pattern is repeated.


RepetitionPattern.Duration As String

Property value

How long the pattern is repeated. The format for this string is PnYnMnDTnHnMnS, where nY is the number of years, nM is the number of months, nD is the number of days, 'T' is the date/time separator, nH is the number of hours, nM is the number of minutes, and nS is the number of seconds (for example, PT5M specifies 5 minutes and P1M4DT2H5M specifies one month, four days, two hours, and five minutes). The minimum time allowed is one minute.

If no value is specified for the duration, then the pattern is repeated indefinitely.


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

When reading or writing XML for a task, the repetition duration is specified in the Duration element of the Task Scheduler schema.


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Type library




See also

Task Scheduler



Community Additions

© 2015 Microsoft