Compartir a través de


RenameItemEx method of the Win32_OfflineFilesCache class

Renames an item in the cache. This method is identical to the RenameItem method, except that it will attempt to do the rename operation right away.

Syntax

uint32 RenameItemEx(
  [in] string  OriginalPath,
  [in] string  NewPath,
  [in] boolean ReplaceIfExists
);

Parameters

OriginalPath [in]

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

NewPath [in]

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

ReplaceIfExists [in]

This parameter is reserved for future use.

Return value

This method returns either a WMI return code or a system error code.

Remarks

This method does not require system administrator privilege.

If the item to be renamed is a file or directory, it must obey the file system semantics for the rename operation. If the file or a child file (for a directory) is already open, the rename will fail. Also, this method attempts to perform the rename as long as the user has access to the item that is being renamed.

If you need to minimize the chance that the item is in use, call the RenameItem method instead.

Requirements

Minimum supported client
Windows 7 with SP1
Minimum supported server
Windows Server 2008 R2 with SP1
Namespace
Root\CIMv2
Header
Cscobj.h
MOF
OfflineFilesWmiProvider.mof
DLL
CscObj.dll

See also

Win32_OfflineFilesCache