Best way to map Windows network drives on OS X?

Soldato
Joined
22 Jun 2004
Posts
2,756
Location
Bangkok, Thailand (formally London)
Howdy,

I'm hoping someone can help here... well I'm just hoping there is a better way to do this?

I work from home as a Web Developer, and I have been a Windows user for years now, but recently converted to Mac OS X, and am loving it! But there is one VERY annoying thing that I cannot solve, and I am hoping it can be sorted on OS X, otherwise this is something Windows wins hands down with :)

What is the best way to map network drives on OS X? I have a Windows 2003 server running at home that has all my websites etc on, so I use this everyday. On Vista/XP etc its very simple, you just map the drive and it will appears as X/Y/Z etc in your "My Computer" and I can just use Z: in all my apps to find the files there. The drive stays the forever unless I tell it not to or the server is not running!

Well in OS X I have found the drive on the network I want to connect to, once I authenticate, it appears on my desktop as a server icon. Double clicking this takes me to that drive, great!

Well upon rebooting it disappears, kinda expected, so I reconnect to the server, get it on my desktop, then I drag it to my "Login items" in System Prefs -> Accounts. Now whenever I reboot, enter my password, the drive appear (slowly... but they appear!). My problems are below:

1. Everytime I reboot the folder open up on my desktop and its annoying! I check the "hide" checkbox next to the items in my "Login Items" screen, but this does absolutely nothing? The windows still appear on login? And the drives connect on login? Whats the point in that checkbox?

2. This is the must annoying thing, whenever my MacBook Pro goes to sleep, so do those connections? When I wake the laptop up, blam, all my networked icons gradually disappear from my desktop... I see them doing it? Why is this? I have to then go thru the tedious process of bring them back?

3. I draged the icons to the dock, and I can connect to them there, but I will still have to do this after number 2 happens?

Does anyone else here use Windows drives on their mac? And use them a lot? What is the best way to do this? I just want them to appear on the desktop when I login and stay there no matter what? Can this be done?

Any help/advice on this would be appreciated!

ta

Steve
 
At work the way the marketing girls solved this problem on their macs was to map the network drives and then create a shortcut to them all in a 'Network Drives' folder.

All they had to do was to launch a shortcut when they needed it and they would connect up to the server
 
i need it all the time though, i may sound VERY lazy, but I dont want to have to keep reconnecting to it on boot?

I mean the way I said above with the login items works well, just the drives keep disappearing when my mac goes to sleep? Its odd, as Im sure its not suppose to do that... right?
 
Its most likely because the network/wireless card is going to sleep, which is causing the link to drop.

Not 100% sure if its possible but can you set your network cards to not sleep when the computer does ?
 
I was going to help but I just have to point out that a question mark does not equal a full stop.

Also I think there's nothing you can do about this.
 
I have my iMac setup to automatically mount things from my downstairs Mini. I tried a few different ways of doing it, but settled on this one because it's quick and easy to change and I can manually run the mounting app if something goes a bit funny with the network. Assuming I haven't completely mis-understood your question (I do that a lot :p) you can create a script in the script editor along the lines of:

Code:
delay 2

tell application "Finder"
	activate
	
	try
		mount volume "afp://downstairs-mini.local./SRBIGEXT"
	end try
	
	try
		mount volume "afp://downstairs-mini.local./srobbins"
	end try
end tell

The delay at the top is down to the wireless taking a short amount of time to re-connect wireless; without it the first mount always seems to fail.

Once you've put the correct shares in, save it as an application (file, save as, choose application as the type - you might also want to save it as a script for future editing) then add the application to your login items (system preferences, accounts, your account, login items, + sign). Once that is done you should get the drives automatically mounting when you login.

To do the same thing when waking from sleep you need to install a 3rd party piece of software called SleepWatcher. Once that is installed you create a file called .wakeup in your home directory and shove something along these lines in there (replacing the location and name of the mounter application as appropriate):

Code:
#!/bin/bash
~/documents/mounter.app

If all goes according to plan you should always have those drives there, whether you boot up normally or wake from sleep.

The are other ways to do it with the automounter etc but as I said, this is my preferred method.
 
Great tip beepcake will have to try it out. Networking is the only thing in mac osx which is annoying! I wonder if Leopard will be any better at network shares?

P.S. also found this hint which seems similar but beepcakes way seems better/easier :)
 
Ok that script worked... to a degree, but everytime I login I get the "Script" icon appear in the dock bouncing at me, I have to click that and I see a prompt that says "Press Run to run thsi script, or Quit to quit"... do you get this beepcake? I checked the hide checkbox in the login items, but as before, this does nothing different, Any ideas?
 
Ok I fixed that problem, got the script working like a beaut... but sleepwatcher WILL NOT remount them on wake. I tried your example above, and I also tried: osascript scriptname.scpt but this also refuses to work, any ideas why this isn't working?

EDIT: I decided to whack the osascript command i mentioned above, straight into the /etc/rc.wakeup file using vi, and it works like a dream now! for some reason, it would appear the sleepwatcher was not running scripts *.wakeup/*.sleep in my home directory, this was the only way I could see around it!
 
Last edited:
It's not *.wakeup it's just .wakeup (you probably need to make it with vi as it's a 'hidden' file).. glad you got it working anyway :)

Yep my bad, i renamed it to .wakeup and vi'd it... as im new to mac, I didn't realise the rubbish that textedit lobs in there... its not like notepad on PC, so I had to vi and remove all that gunk and it works a treat now!

I have had to do two scripts though, I dont have the "delay" issue on my mac, so I can run the script instantly and it works a treat.

But upon waking up after a sleep, i ALWAYS see my mounted drives for a few seconds, then they gradually disappear. So upon waking sleepwatcher runs the script immediately, well at this point the drives are mounted so it doesn't do anything.. then a few seconds later they unmount.

So I have created a replica script, but just added "delay 5" at the top. Not tested it yet though, cos oddly if my mac is only a sleep for a few minutes, the drives remain mounted... only if my mac is asleep for a while do it do the unmount thing.

I hope Leopard fixes all this mounting/sleep probs!

Thanks for your help though Beepcake, its worked very well!
 
Back
Top Bottom