ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
Jam.Shell.Dialogs.FileOperation.TJamFileOperation.Rename

Renames a file or folder.

Syntax
Pascal
class procedure Rename(const pFileName: string; const pNewname: string; pOptions: TOperationOptions = soDefault); overload; static;
Parameters 
Description 
const pFileName: string 
The file or folder that should be renamed.  
const pNewname: string 
The new name of the specified file or folder.  
pOptions: TOperationOptions = soDefault 
Optional: The options to use.  

To avoid name conflicts use TOperationOption.soRenameCollision in Options.

Exceptions 
Description 
EArgumentException 
if any parameter is empty.  

The following example shows how to rename a file:

  TJamFileOperation.Rename('C:file.exe', 'New name.exe');