IMSAdminBase::RenameKey

The IMSAdminBase::RenameKey method renames a key in the metabase.

HRESULT RenameKey(

  METADATA_HANDLE hMDHandle,  //metabase handle to the key.

  LPCWSTR pszMDPath,    //path of the key, relative to hMDHandle.

  LPCWSTR pszMDNewName   //new name for the key.

);

 

Parameters
hMDHandle
Specifies a handle to a metabase key. This can be either METADATA_MASTER_ROOT_HANDLE, or a handle with write permissions returned by the IMSAdminBase::OpenKey method.
pszMDPath
Points to a string that contains the path of the key, relative to the path of hMDHandle. For example, if the handle references the /LM key, you could specify the virtual directory, VDir1, on the third Web server by using the path /W3SVC/3/ROOT/VDir1.
pszMDNewName
Points to a string that contains the new name for the key.
Return Values

Returns an HRESULT that contains one of the following values:

Value Description
ERROR_ACCESS_DENIED Access is denied. Either the open handle does not have read or write permission as needed, or the user does not have sufficient permissions to perform the operation.
ERROR_DUP_NAME A key of that name already exists in the metabase.
ERROR_INVALID_PARAMETER The parameter is incorrect.
ERROR_NOT_ENOUGH_MEMORY Not enough memory is available to process this command.
ERROR_PATH_NOT_FOUND The specified path was not found in the metabase.
ERROR_SUCCESS The method succeeded.