Files.Mount
-----------

Mounts a network share.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Files](component_Files.md) | [5.1](newinversion51.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |

MBS( "Files.Mount"; URL { ; Dest; UserName; Password; Interactive; Prompt } ) 

**MBS**( **"Files.Mount";** /\* Mounts a network share. \*/  
**$URL**; /\* The URL for the network resource. \*/   
**$Dest**; /\* Optional; The destination path to mount to. If you leave this empty, the system decides. On Mac this can be the path to a folder where to mount new disk inside, e.g. to make a private mount.e.g. "" \*/   
**$UserName**; /\* Optional; The user name. If none is provided, system can take credentials from keychain.e.g. "test" \*/   
**$Password**; /\* Optional; The password to use.e.g. "test" \*/   
**$Interactive**; /\* Optional; Default is 0 for no dialogs. But you can pass 1 to have a dialog show up.e.g. 1 \*/   
**$Prompt**) /\* Optional; Pass 1 on Windows to show dialog always to enter password.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| URL | The URL for the network resource. |  |  |
| Dest | The destination path to mount to. If you leave this empty, the system decides. On Mac this can be the path to a folder where to mount new disk inside, e.g. to make a private mount. | "" | Optional |
| UserName | The user name. If none is provided, system can take credentials from keychain. | "test" | Optional |
| Password | The password to use. | "test" | Optional |
| Interactive | Default is 0 for no dialogs. But you can pass 1 to have a dialog show up. | 1 | Optional |
| Prompt | Pass 1 on Windows to show dialog always to enter password. | 0 | Optional |

### Result

Returns path or error.

### Description

Mounts a network share.  
Use on Server may require extra work as server runs with a different user account than you being logged in on the server machine. Permissions don't always allow things to be done.  
  
When used on Linux the parameters are a little bit different:  
Please pass source (URL), target (Dest), filesystemtype (Username) and data (Password).  
Values for the filesystemtype argument supported by the kernel are listed in /proc/filesystems (e.g., "btrfs", "ext4", "jfs", "xfs", "vfat", "fuse", "tmpfs", "cgroup", "proc", "mqueue", "nfs", "cifs", "iso9660"). Further types may become available when the appropriate modules are loaded.  
The data argument is interpreted by the different filesystems. Typically it is a string of comma-separated options understood by this filesystem.   
The dest path may need to be created first as new folder.  
### Examples

Mount Ablage1 on Mac:

 MBS ("Files.Mount"; "afp://Ablage1.local"; ""; ""; "")  
Mount Ablage1 on Mac with password:

 MBS ("Files.Mount"; "afp://Ablage1.local"; ""; "root"; "xxx")  
Mount something on Windows:

 MBS ("Files.Mount"; "\\\\\\\\myServer\\\\public"; "X:"; ""; "")  
Mount Ablage 2 on Windows:

 MBS ( "Files.Mount"; "\\\\\\\\Ablage2.local\\\\Ablage2"; "H:" )  
\# password already known to Windows   
Mount Ablage 2 on Windows with password:

 MBS ( "Files.Mount"; "\\\\\\\\Ablage2.local\\\\Ablage2"; "H:"; "root"; "xxx" )  
Unmount drive:

 MBS ("[Files.Unmount](FilesUnmount.md)"; "H:")  
Mounts AFP volume with space in name:

 MBS ( "Files.Mount"; "afp://192.168 .168.250 /Customer%20Data" )  
Mount on Linux:

 MBS ( "Files.Mount"; "//192.168 .101.100 /sales"; "/mnt/test"; "cifs"; "username=shareuser,password=sharepassword,domain=nixcraft")  
Mount SMB share from Windows Server 2012:

 MBS ("Files.Mount"; "\\\\\\\\192.168 .0.242 \\\\ERP"; ""; "SRV2012\\bob"; "test")  
  
\# please note the SRV2012\\ prefix for the user name for this Windows server.   
Mount with properly encoding french accent:

 Set Variable \[ $path ; Value: MBS ( "Files.Mount"; "afp://stockage.madabout.lu/" &amp; MBS ( "[Text.EncodeURLComponent](TextEncodeURLComponent.md)"; MBS ( "[Text.ConvertUnicodeToCharacterDecomposition](TextConvertUnicodeToCharacterDecomposition.md)"; "Travail archivé" )); "UTF-8" )) \]  
  
\# URL is "afp://test.myserver.local/Travail%20archiv%8E"   
### See also

- [Files.MountPath](FilesMountPath.md)
- [Files.Unmount](FilesUnmount.md)
- [Text.ConvertUnicodeToCharacterDecomposition](TextConvertUnicodeToCharacterDecomposition.md)
- [Text.EncodeURLComponent](TextEncodeURLComponent.md)

### Release notes

- **Version 15.5**
    - Fixed [Files.Mount](https://www.mbsplugins.eu/FilesMount.shtml) to return the path. Broken in 15.4.
- **Version 15.4**
    - Rewrote [Files.Mount](https://www.mbsplugins.eu/FilesMount.shtml) for macOS to user newer API and get mounting of folders on shares via SMB.
- **Version 14.3**
    - Changed [trace](https://www.mbsplugins.eu/Trace.shtml) function to not log the password for a [Files.Mount](https://www.mbsplugins.eu/FilesMount.shtml) call.
- **Version 12.2**
    - Fixed [Files.Mount](https://www.mbsplugins.eu/FilesMount.shtml) to return correct path when mounting to a folder.
- **Version 8.3**
    - Added [Files.MountPath](http://www.mbsplugins.eu/FilesMountPath.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 15.5pr2](https://www.mbsplugins.de/archive/2025-10-08/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS @ FMTraining.TV - FileMaker MBS Plug-in Q&amp;A](https://www.mbsplugins.de/archive/2025-09-10/MBS_@_FMTrainingTV_-_FileMaker/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.4pr3](https://www.mbsplugins.de/archive/2025-08-19/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.3pr1](https://www.mbsplugins.de/archive/2024-06-03/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.2pr1](https://www.mbsplugins.de/archive/2022-04-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Network share access from script on FileMaker Server](https://www.mbsplugins.de/archive/2019-11-08/Network_share_access_from_scri/monkeybreadsoftware_blog_filemaker)
- [Adding Bonjour functions for MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2018-07-28/Adding_Bonjour_functions_for_M/monkeybreadsoftware_blog_filemaker)
- [Tip of the day: Mount drive on FileMaker Server](https://www.mbsplugins.de/archive/2016-07-05/Tip_of_the_day_Mount_drive_on_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.2pr1](https://www.mbsplugins.de/archive/2015-06-01/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 5.1 for OS X/Windows](https://www.mbsplugins.de/archive/2015-05-19/MBS_FileMaker_Plugin_51_for_OS/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 10th May 2015 , last changed 4th March 2022

  
[Files.ModificationDate](FilesModificationDate.md) - [Files.MountPath](FilesMountPath.md)

[HTML Version](FilesMount.shtml)