Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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...

share|improve this question
up vote 5 down vote accepted

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .