Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 11.0   11.1   11.2   11.3   11.4   11.5   12.0   12.1   12.2   12.3    Statistic    FMM    Blog  

Files.Mount

Mounts a network share.

Component Version macOS Windows Linux Server iOS SDK License
Files 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ❌ No Paid
MBS( "Files.Mount"; URL { ; Dest; Username; Password; Interactive; Prompt } )   More

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"; "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/" & MBS( "Text.EncodeURLComponent"; MBS( "Text.ConvertUnicodeToCharacterDecomposition"; "Travail archivé" )); "UTF-8" )) ]

# URL is "afp://test.myserver.local/Travail%20archiv%8E"

See also

Release notes

Blog Entries

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


Files.ModificationDate - Files.MountPath

Feedback: Report problem or ask question.


Start Chat