Jump to content
Sign in to follow this  
jhogarty

Map Shares on Login

Recommended Posts

I posted a similar post on MacNN but thought I'd share here too in case MacCast listeners/readers don't visit that site, or it gets lost somehow. Wasn't sure if Adam is ok with cross linking so here is the copy from what I posted. Thanks.

 

 

One thing I had some trouble with, coming from the Windows world, was mapping network drives. In Windows, for my Home network, I created batch files and launched them on startup if needed. Some versions of Windows would remember my network connections. Anyways, I wanted the same thing for my Macs, so this is what I came up with.

 

Now there might be a better faster way, but here is how I did it:

 

1. Created two Alias' for my two desired Samba Shares:

a. LINUX_DATA

b. USERS

 

2. Add those two items to your Login Items under System Preferences.

System Preferences: Accounts: {select_desired_login-account}: Login Items

Click on the + button

Select your Alias for your first share (ie. LINUX_DATA)

 

Repeat for each share (ie. USERS in my case)

 

Now looking back, I think I could have just mounted the two shares through the finder and added them that way instead of making the alias'.

 

Logout and back in and it should mount your shares. Problem I had was now I also had two finder windows up. I like starting with a clean desktop.

 

3. Ok, now to clean up those windows. Launch Applescript (Applications:AppleScript:Script Editor)

 

Copy and Paste the syntax below, replacing the Share Names that I have with the ones you want to use:

 

tell application "Finder"

close window "LINUX_DATA"

close window "USERS"

end tell

 

Again, remember to swap out my LINUX_DATA and USERS share names with yours.

 

Choose File:Save As. Give it a neat name, and choose Application as the type. I saved mine in the Applications:Utilities area. This way anyone who uses the computer can add this to their Login Items.

 

4. Go back to System Preferences:Accounts:{select_desired_login-account}: Login Items and add your new application to the list.

 

5. Logout and back in. If we did it right, your two shares should mount and the windows for those shares should close.

 

Hope this helps. Been meaning to find/make a solution like this for myself for a while. Finally got around to it.

 

If there is a better way to do this, I would love to know. This is a work around/solution that I tinkered with and it does what I want.

 

Thanks for reading,

 

J.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing

    No registered users viewing this page.

  • Who's Online (See full list)

    There are no registered users currently online

×