IIdleSettings::IdleDuration property

Gets or sets a value that indicates the amount of time that the computer must be in an idle state before the task is run.

This property is read/write.

Syntax


HRESULT put_IdleDuration(
  [in]   BSTR delay
);

HRESULT get_IdleDuration(
  [out]  BSTR *pDelay
);

Property value

A value that indicates the amount of time that the computer must be in an idle state before the task is run. 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 value is one minute. If this value is NULL, then the delay will be set to the default of 10 minutes.

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 Duration 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

Task Scheduler
IIdleSettings

 

 

Community Additions

ADD
Show:
© 2015 Microsoft