Skip to main content

Mount Disk (script step reference)

By June 1, 2024June 4th, 2024Online Help, Troi File Plug-in
Troi File Plug-in for FileMaker Pro

Mount Disk

Connect to a shared network volume, by mounting the disk. You can then for example read or save files on this disk.

SyntaxScript step badge

Mount Disk [ Select ; Result (error) ; Zone ; Server ; Disk ; User name ;
             Password ; Reuse drive letter ]

Options

Select entire contents replaces the entire contents of a field with the result. If not checked the result replaces the currently selected portion of the field
Result (error) an error code
Zone (optional) the name of the AppleTalk zone (on Windows this parameter is not used)
Server on Mac the name of the Server, on Windows the UNC name of the share
Disk on Mac the name of the disk, on Windows (optional) the drive letter to use
User name (optional) the name of the user (if empty guest access is tried)
Password (optional) the password of this user
Reuse drive letter (default) if the network disk already is mapped reuse that drive letter (on Windows)

Returned Result

Data type returned

Error code

Result

On macOS The returned result is an error code. If no error occurs a zero is returned.
On Windows the returned result is the drive letter or an error code. An example drive letter can be: “F:”

An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:

0 no error the disk was mounted
$$-35 nsVolErr no such volume, disk not found
$$-50 paramErr parameter error, check if the supplied parameters are correct
$$-5023 the user is not authorized for this volume
$$-5000 insufficient access privileges for operation
$$67 (Windows) the specified UNC name is invalid or can not be found
$$1200 (Windows) the specified drive letter is invalid. Enter a valid drive letter, like “K:”
$$2250 (Windows) not connected to a network

Originated in

Troi File Plug-in 9.0

Compatibility

FileMaker Pro 17 to FileMaker Pro 21 (2024)

Considerations

Due to differences in operating systems this function behaves a bit different on Mac compared to Windows. On Windows there is no zone name for example. See the platform specific examples below.

On macOS the plug-in also supports URL style AFP (AppleTalk File Protocol) servers. See also the examples below.

Regarding sending passwords on macOS: the plug-in always tries to use 2 way encrypted passwords.

On Windows the “server” parameter should be a UNC name, formatted like “\\servername\share”. Also on Windows the parameter “disk” indicates the drive letter to use, like “K:”. If empty the function picks a free drive letter.

IMPORTANT On some Windows implementations the username and password parameter have been switched. If you get a authorization error, try reversing the username and password!

After mounting the shared disk icon should appear on your desktop (on macOS) or in the My Computer folder (on Windows). Depending on your access privileges, you can copy files, create folders and use items on the shared disk as if they were on your local hard disk.

Example

macOS :

Mount Disk [ Select ; $ErrorCode ; "MacZone" ; "McServer" ; "Shared Disk" ; "George" ; "secret" ]
Mount Disk [ Select ;  $ErrorCode ; "" ; "McServer" ; "Guest folder" ]

The first step will mount the hard disk “Shared Disk” of server “McServer” in zone “MacZone” using the user name “George” with password “secret”.
The second step will mount the volume “Guest folder” of server “McServer” using guest access. As the zone parameter is empty, the server can be in any zone.

The plug-in also supports URL style AFP servers names. For example a server on the intranet:

Mount Disk [ Select ; $ErrorCode ; "" ; "afp://192.168.1.55" ; "Shared Disk" ]

The plug-in also supports URL style WebDAV server names on macOS . For example an iDisk server:

Mount Disk [ Select ; $ErrorCode ; "" ; "http://idisk.mac.com/youridiskname" ; ""  ]

You can also connect to servers on the public Internet, for example:

Mount Disk [ Select ; $ErrorCode ; "" ; "afp://tramp.tr.fh-hannover.de" ; "Oeffentliche_Software"  ]

On Windows:

Mount Disk [ Select ; $ErrorCode ; "unused zone" ; "\\Troi Server\Projects" ; 
			"" ; "George" ; "secret" ; Reuse drive letter ]
Mount Disk [ Select ; $ErrorCode ; "unused zone" ; "\\Troi Server\Projects" ; "Z:" ]

The first step will mount the share “Projects” of server “Troi Server” using the user name “George” with password “secret”. The second step will mount the same share using guest access, and mounting it as drive “Z:”.

Related script stepScript step badge

Unmount Disk

Related functionsFunction badge

TrFile_DiskInfo
TrFile_MountDisk

Related topics

Troi File Plug-in online help (overview)


Online Help Page for Troi File Plug-in for 16 to 2024 –> Mount Disk (filep7261) 2024-0604 19:06:03