DeleteExpiredTaskAfter (settingsType) Element

Specifies the amount of time that the Task Scheduler will wait before deleting the task after it expires. If no value is specified for this element, then the Task Scheduler service will not delete the task. 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). For more information about the duration type, see

<xs:element name="DeleteExpiredTaskAfter"

The DeleteExpiredTaskAfter element is defined by the settingsType complex type.

Parent element

Element Derived from Description
Settings settingsType Contains the settings that the Task Scheduler uses to perform the task.


For C++ development, see DeleteExpiredTaskAfter Property of ITaskSettings.

For script development, see TaskSettings.DeleteExpiredTaskAfter.


The following XML defines a settings element that deletes an expired task after one week.



Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]

See also

Task Scheduler Schema Elements