IBITSExtensionSetup::GetCleanupTask method (bitscfg.h)

Use the GetCleanupTask method to retrieve an interface pointer to the cleanup task associated with the virtual directory.

Syntax

HRESULT GetCleanupTask(
  [in]  REFIID   riid,
  [out] IUnknown **ppUnk
);

Parameters

[in] riid

Identifies the task scheduler interface to return in ppTask. For a list of identifiers, see the ITaskScheduler::Activate method.

[out] ppUnk

A pointer to the interface specified by riid. Use the interface to modify the properties of the task. Release ppTask when done.

Return value

This method returns S_OK for success. Otherwise, the method returns S_FALSE if a task has not been created for the virtual directory.

Remarks

When you create a virtual directory and enable it for BITS uploads, BITS adds a work item in the Task Scheduler. The work item cleans up the virtual directory once every 12 hours by deleting jobs that have not been modified within the time-out period. To specify the time-out period, set the BITSSessionTimeout IIS extension property.

To change the cleanup schedule, see the BITSCleanupUseDefault BITS IIS extension property.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2003
Target Platform Windows
Header bitscfg.h
DLL BitsMgr.dll
Redistributable BITS 1.5 on Windows XP

See also

IBITSExtensionSetup::EnableBITSUploads

IBITSExtensionSetup::GetCleanupTaskName