Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mount network drives

Hi,

How can I create a script that will connect to a windows server with a username and password and mount network drives on my desktop, and how do I set this script to automatically run when I login?

MacBook, iMac G3, Power Mac 8500, PowerBook 180, Mac OS X (10.6.2)

Posted on Mar 30, 2010 4:27 PM

Reply
Question marked as Best reply

Posted on Mar 30, 2010 5:24 PM

Hi

You could try this script saved as an application, then add it to your login-items, just change the user name, op etc to suit

tell application "Finder"
mount volume "smb://username:password@000.000.000.000/servervolume"
end tell



Budgie
7 replies

Mar 30, 2010 5:33 PM in response to kevinhodge

What budgie said. Also, you don't need AppleScript. Mount the disk once, open System Preferences, select the 'Accounts' preference pane, and click the 'Login Items' tab. Drag the icon for the disk into the list of login items. It will automatically connect to that disk next time you login.

If you prefer the UNIX way, you can also simply do this in a shell script:

#!/bin/sh
open smb://username:password@000.000.000.000/volume

Apr 12, 2010 5:23 AM in response to kevinhodge

Hey guys. I'm glad I found this post. I'm trying for the same result. I currently work at a school in which every teacher has a computer that connects to the local network by signing in with a username and password. However, my computer has fried and they can't get me a new one until... well... whenever. I've brought my MacBook Pro in and have connected to the internet which is great but I need to access a network (H:) drive in order to update progress reports and report cards.

I don't know much and the IT guy is impossible to reach and hasn't returned any emails. I just need to connect to that one folder. I was assuming and ftp or and smb would do the trick but I have no idea what server I would need to try and access through the finder, applescript, or terminal. I did an ipconfig on another teachers computer and got a few ip's as well as the folder's location on the network 'server_4\folder' (H:) if that helps. I've tried connected by ftp through the finder to all of the ip's and have gotten an error saying that I can't connect. I have also did a whatsmyip.com search for my root ip address and have tried the same approach. For some reason, it connects by says my username and password were incorrect.

Well that's about everything. Any help would be greatly appreciated!

Apr 12, 2010 10:57 AM in response to J D McIninch

J D McIninch wrote:
Mount the disk once, open System Preferences, select the 'Accounts' preference pane, and click the 'Login Items' tab. Drag the icon for the disk into the list of login items. It will automatically connect to that disk next time you login.


Every once in a while, a gem so pure and simple pops up that makes everything else sparkle. This is one of them. *J D*, thank you very much for this exquisite tip. It opens up a whole new world of simplicity.

Apr 12, 2010 12:34 PM in response to MathTeacher503

On OS X, you access Windows shares (the "H:" drive) through SMB, not FTP. In Finder, select "Go > Connect to server..." from the menu. A small dialog will pop-up, where you can specify the URL for the server. The URL for a Windows server is:


smb://servername/sharename


... you can also specify your username and password for that share as part of the URL:


smb://username:password@servername/sharename


... though, if you don't, you'll be prompted for the username and password. In your case, the URL would look like this:


smb://server_4/folder


... and you will have mounted on your system a share named 'folder' which will appear on your desktop and/or the sidebar (depending on your preferences for showing connected machines and disks). Just like AFP shares, you can drag the icon into the login items panel for your user account and it will automatically connect when you login (and are on the network where the share is).

Mount network drives

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.