Apple OSX HowTo's Scripting HowTo's

Connect to SMBFS Shortcut Mac

If you need a way to connect to your home Windows File Server from your Mac without dropping to the command line all the time then the following will be for you.

Open Terminal and run the following

cd ~/
mkdir Stacks
cd Stacks
mkdir Server_Connect
cat > connect.txt
mkdir /Volumes/Home
mount -t smbfs //Username@serveraddress/pathtoshare /Volumes/Home
ctrl D
mv connect.txt connect.command
chmod 775 connect.command 

Now you will be able to connect to your server by clicking the icon of that file no more having to drop to command line for you. You will be prompted for a password when you connect because you do not want to be storing that in your script

If you are like me you may also want to consider making a disconnect script so that you can disconnect when you are done, you can see the code for that below. 

cd ~/Stacks/Server_Connect
cat > disconnect.txt
mount /Volumes/Home
ctrl D
mv disconnect.txt disconnect.command
chmod 775 disconnect.command

Now you can pin that folder to your icon bar and be able to connect to our SMBFS based fileserver with a click if a button.

Similar Posts: