Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1    Statistic  


Renames a file or folder without user interface.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Files 2.8 Yes Yes Yes Yes Yes

MBS( "Files.RenameFile"; Path; NewName )


Parameter Description Example value
Path The native path to the file or folder to be renamed. "/Users/John/Desktop/test.txt"
NewName The new name. "testfile.txt"


Returns OK or error message.


Renames a file or folder without user interface.
Path must be valid and exist.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.


Rename file on Windows with full path:

MBS( "Files.RenameFile"; "\\FileServer\Dokumente\VK\123456\RG249388345.pdf" ; "\\FileServer\Dokumente\VK\123456\Rechnung_249388345.pdf" )

Rename file on OS X:

MBS( "Files.RenameFile"; "/Users/cs/Desktop/test"; "Hello World, just a test!" )

Rename on Windows:

MBS( "Files.RenameFile"; "C:\Users\Administrator\Desktop\alt.fmp12"; "neu.fmp12")

See also

Files.ReadPNG   -   Files.ResolveBookmark

Feedback: Report problem or ask question.

MBS Xojo Plugins