IOfflineFilesCache::RenameItem method (cscobj.h)

Renames an item in the cache. This method logs a request with the Offline Files service for a path to be renamed on the next system restart.

Syntax

HRESULT RenameItem(
  [in] LPCWSTR pszPathOriginal,
  [in] LPCWSTR pszPathNew,
  [in] BOOL    bReplaceIfExists
);

Parameters

[in] pszPathOriginal

Fully qualified UNC path of the item (server, share, file or directory) to be renamed.

[in] pszPathNew

The new path to replace pszPathOriginal if the item that pszPathOriginal points to exists in the cache.

[in] bReplaceIfExists

This parameter is reserved for future use.

Return value

Returns S_OK if successful, or an error value otherwise.

Remarks

This method requires system administrator privilege.

Note  A restart of the system is necessary for the rename operation to be applied to the Offline Files cache.
 
This method fails if the path referenced by the pszPathNew parameter already exists in the Offline Files cache.

Beginning with Windows 8 and Windows Server 2012 you can also use the IOfflineFilesCache2::RenameItemEx method to rename an item. It does not require system administrator privilege or a system restart. However, it will fail if the item is currently in use.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header cscobj.h
DLL CscSvc.dll; CscObj.dll

See also

IOfflineFilesCache

IOfflineFilesCache2::RenameItemEx