Folder.Rename

Folder.Rename ( 

string OldName,

string NewName )

Example 1

Folder.Rename("C:\\Stored", "C:\\OldStored");

Renames the folder located at "C:\Stored" to "C:\OldStored."

Example 2

Folder.Rename(_ProgramFilesFolder .."\\My Application\\Data", _ProgramFilesFolder .."\\My Application\\DataBK");

Renames the "Data" folder located in the My Application folder  to "DataBK."

Note: _ProgramFilesFolder is a built-in variable that contains the path to the user's Program Files folder.

Example 3

-- Renames a current folder.
Folder.Rename("C:\\My Folder", "C:\\My New Folder");

-- Get the error code for the rename action.
error = Application.GetLastError();

-- If an error occurred, display the error message.
if (error ~= 0) then
    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
end

Renames "My Folder"  to "My New Folder" and displays an error message if the action fails.

See also:  Related Actions