I have a script that reads data from


Each time run it, I have to open Finder and navigate to the relevant network share in order to make OSX mount the volume. Is there a way to get OSX to mount the network volume automatically from a script? Any language is fine, as is a shell command. I guess applescript will be a candidate...


You could use the mount command. It supports several network share formats.

This is for a samba (Windows) share

sudo mount -t smbfs -o username=RemoteUser //REMOTEHOST/directory /Volumes/somenetworkdir

man mount in a terminal will show you the full list of options.

Since this depends on a script, you could include this call prior to accessing that share.

If this is a share you are not always on a network which is permitted to connect to it, have a look at ControlPlane. It will let you run something when on a certain network, so you could mount this share whenever you connect to this shares network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.