Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mount Shares on Startup

Status
Not open for further replies.

Burgal

MIS
Jan 3, 2003
246
CA
Hi there.

I'd like to be able to mount SMB shares off a PC network when a users start up their mac.

I can drag a share into the login items, but that causes a window for each share to automatically open when the mac is restarted. Is there a convenient way to mount shares, and not have their windows open up on startup?
 
Yeah you can create an apple script and then put that in the start up items.
From Thursby.com web site.

For Mac OS X 10.1.x:

tell application "Finder"
try
open location "cifs://SERVER/SHARE"
end try
end tell

----------

For Mac OS X 10.2 (Jaguar) :

tell application "Finder"
try
mount volume "cifs://SERVER/SHARE"
end try
end tell

----------

For Mac OS X 10.3 (Panther) :

tell application "Finder"
try
delay 10
mount volume "cifs://SERVER/SHARE"
end try
end tell

------------

Save this file with the file format set to "Application" (Make sure that it is not set to stay open and not show a startup screen unless so desired)

Replace SERVER and SHARE for the name of the server and share you are wanting to mount at startup. If you wish to mount more than one volume at startup, you do not need to make separate scripts for each volume. Simply add a line in the script for each volume you wish to mount.

If you are using Mac OS X 10.2, drag the AppleScript you've created into the Login Items preference window (System Preferences/Login Items). If you are using Mac OS X 10.3, you will need to go into the Accounts preference in System Preferences. Here you will select the user that wants the mount at boot time option and choose the Startup Items tab. Drag the Applescript you created into this window.

If you wish to mount volumes automatically without entering your username and password (if it is a user-level share), you will have to include this in the CIFS URL. For example:

cifs://DOMAIN;USERNAME:pASSWORD@SERVER/SHARE

If not, you will be prompted for this information before the volume will mount. Restart your Macintosh and login, and the volume will mount on your desktop momentarily.

Please remember that if you use any special characters in a username, password or server, you must change them as follows:

@ to %40
: to %3A
; to %3B
/ to %2F
to %20


I don’t know half of you half as well as I should like, and I like less than half of you half as well as you deserve. ~ Baggins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top