Files.MoveFile
--------------

Moves a file or folder without user interface.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Files](component_Files.md) | [2.8](newinversion28.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Files.MoveFile"; SourcePath; DestPath { ; Overwrite; SkipSourcePermissionErrors; ProgressTitle } ) 

**MBS**( **"Files.MoveFile";** /\* Moves a file or folder without user interface. \*/  
**$SourcePath**; /\* The native path to the file or folder to be moved.e.g. "/Users/John/Desktop/test.txt" \*/   
**$DestPath**; /\* The native path to the destination folder or file.e.g. "/Users/John/Desktop/Backup/" \*/   
**$Overwrite**; /\* Optional; Mac only: Whether to allow overwriting existing files.   
Default is off. Pass 1 to enable and 0 to disable.  
On Windows, it overwrites always.e.g. 1 \*/   
**$SkipSourcePermissionErrors**; /\* Optional; Mac only: Whether to skip files with permission errors.   
Default is off. Pass 1 to enable and 0 to disable.e.g. 1 \*/   
**$ProgressTitle**) /\* Optional; Title for the progress window.  
For Windows only and the text may not be visible in your version of Windows.e.g. "Copying FileMake files" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| SourcePath | The native path to the file or folder to be moved. | "/Users/John/Desktop/test.txt" |  |
| DestPath | The native path to the destination folder or file. | "/Users/John/Desktop/Backup/" |  |
| Overwrite | Mac only: Whether to allow overwriting existing files.    Default is off. Pass 1 to enable and 0 to disable.   On Windows, it overwrites always. | 1 | Optional |
| SkipSourcePermissionErrors | Mac only: Whether to skip files with permission errors.    Default is off. Pass 1 to enable and 0 to disable. | 1 | Optional |
| ProgressTitle | Title for the progress window.   For Windows only and the text may not be visible in your version of Windows. | "Copying FileMake files" | Optional |

### Result

Returns OK or error message.

### Description

Moves a file or folder without user interface.  
SourcePath and DestPath must be valid and exist. So pass destination folder for the destination.   
  
The Linux implementation does only move files within the same file system.  
On Mac you may get error -43 for file not found if you refer to a file in a folder, where you don't have file permissions to look inside the folder.  
  
See also [Files.RenameFile](FilesRenameFile.md) to rename a file.  
  
On Windows, if the destination path is relative, it is applied to the current process' working directory. See [Process.SetCurrentDirectory](ProcessSetCurrentDirectory.md) to change that.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) 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](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Move a file:

 MBS ( "Files.MoveFile"; "C:\\Users\\Christian\\Desktop\\test1.txt"; "C:\\Users\\Christian\\Desktop\\test2.txt")  
### See also

- [Files.CopyFile](FilesCopyFile.md)
- [Files.CopyFiles](FilesCopyFiles.md)
- [Files.ReadFile](FilesReadFile.md)
- [Files.RenameFile](FilesRenameFile.md)
- [Files.RevealFile](FilesRevealFile.md)
- [Files.ShareFile](FilesShareFile.md)
- [Files.WriteFile](FilesWriteFile.md)
- [Process.SetCurrentDirectory](ProcessSetCurrentDirectory.md)
- [WebDownloadDelegate.Path](WebDownloadDelegatePath.md)
- [WebDownloadDelegate.SetFolder](WebDownloadDelegateSetFolder.md)

### Release notes

- **Version 16.0**
    - Fixed an issue with [Files.MoveFile](https://www.mbsplugins.eu/FilesMoveFile.shtml) on Windows when using normal slashes in the path.
- **Version 13.0**
    - Improved [Files.MoveFile](https://www.mbsplugins.eu/FilesMoveFile.shtml) on Linux to allow you to specify a folder as destination.
- **Version 12.0**
    - Added workaround for [Files.MoveFile](https://www.mbsplugins.eu/FilesMoveFile.shtml) and [Files.CopyFile](https://www.mbsplugins.eu/FilesCopyFile.shtml) when it fails with MAX\_PATH error.
- **Version 10.0**
    - Fixed an issue for [Files.MoveFile](https://www.mbsplugins.eu/FilesMoveFile.shtml) and [Files.CopyFile](https://www.mbsplugins.eu/FilesCopyFile.shtml) where unability to move an old file to trash caused a problem on AFP volumes.
- **Version 8.5**
    - Improved error handling for [Files.CopyFile](http://www.mbsplugins.eu/FilesCopyFile.shtml) and [Files.MoveFile](http://www.mbsplugins.eu/FilesMoveFile.shtml).
    - Rewrote [Files.CopyFile](http://www.mbsplugins.eu/FilesCopyFile.shtml) and [Files.MoveFile](http://www.mbsplugins.eu/FilesMoveFile.shtml) for Mac/iOS to better overwrite files.
- **Version 7.0**
    - Added progress window option to [Files.CopyFile](http://www.mbsplugins.eu/FilesCopyFile.shtml) and [Files.MoveFile](http://www.mbsplugins.eu/FilesMoveFile.shtml) for Windows.

### Example Databases

- [Files/FileOperation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Files/FileOperation.shtml#5ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 15.6pr4](https://www.mbsplugins.de/archive/2025-12-22/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 12 - Files](https://www.mbsplugins.de/archive/2023-12-12/MBS_Plugin_Advent_calendar_12_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.0pr8](https://www.mbsplugins.de/archive/2023-01-14/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.6pr4](https://www.mbsplugins.de/archive/2021-12-22/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.6pr3](https://www.mbsplugins.de/archive/2021-12-14/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.6pr2](https://www.mbsplugins.de/archive/2019-12-10/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [FileMaker 18 File Script Steps vs. BinaryFile functions](https://www.mbsplugins.de/archive/2019-06-03/FileMaker_18_File_Script_Steps/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.5pr7](https://www.mbsplugins.de/archive/2018-11-14/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.5pr2](https://www.mbsplugins.de/archive/2018-10-12/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2020, Seite 35](https://filemaker-magazin.de/neuigkeit/4103-Appetithappen-FMM_202004)
- [Ausgabe 2/2017, Seite 40](https://filemaker-magazin.de/neuigkeit/3930-Appetithappen-FMM_201702)

This function checks for a license.

Created 18th August 2014 , last changed 26th February 2023

  
[Files.MountPath](FilesMountPath.md) - [Files.MoveToTrash](FilesMoveToTrash.md)

[HTML Version](FilesMoveFile.shtml)