Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.09 KB

istorageitem_renameasync_247762898.md

File metadata and controls

38 lines (26 loc) · 1.09 KB
-api-id -api-type
M:Windows.Storage.IStorageItem.RenameAsync(System.String)
winrt method

Windows.Storage.IStorageItem.RenameAsync

-description

Renames the current item.

-parameters

-param desiredName

The desired, new name of the item.

-returns

No object or value is returned by this method when it completes.

-remarks

For this method and its overload, if the name you specify is invalid, this method throws an exception. To handle all the ways the specified name could be invalid, you must catch all four of these exceptions:

E_INVALIDARG
E_FAIL
ERROR_FILENAME_EXCED_RANGE
ERROR_INVALID_NAME

If the file is deleted before the rename finishes, this method throws the ERROR_FILE_NOT_FOUND exception. You must also catch and handle this exception when you use this method.

-examples

-see-also

RenameAsync(String, NameCollisionOption)