The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Networking (http://hintsforums.macworld.com/forumdisplay.php?f=14)
-   -   Auto Mount SMB share (http://hintsforums.macworld.com/showthread.php?t=16189)

James T 10-20-2003 10:14 AM

Auto Mount SMB share
 
I've got a G5 that it would be very nice to have automatically connect to a win2K share.

I can connect fine through "connect to server" on finder with smb://server/share but this causes a dialogue to come up prompting for workgroup, username and password. Now the problem is that despite setting the smb workgroup - in utilities>Directory Access finder seems to prompt for the first local workgroup on it's list - which is incorrect. Also this share doesn't have a password.

I have written a short apple script that mounts a number of nfs shares on this machine and it would be nice to add a line to do the w2k ones as well.

So Is there a way to tell finder to use a specific workgroup and no password?

Thanks

James

ulrichm 11-06-2003 09:45 AM

For automounting a smb share I use the following script:
Code:

tell application "Finder"
        try
                mount volume "SMB://<WORKGROUP>;<USER>:<PWD>@<SERVER>/<SHARE>"
        on error
                display dialog "There was an error mounting the Volume." & return & return & ¬
                        "The server may be unavailable at this time." & return & return & ¬
                        "Please inform the Network Administrator if the problem continues." buttons {"Okay"} default button 1
        end try
end tell

I hope it helps. And of course, this goes into the StartupItems.

rozeel 06-13-2004 05:49 PM

Hi,

I would like to do the same but....

where should i place this script to automate its autostart?

TIA

Ronald

Dale Mox 06-13-2004 06:36 PM

Quote:

Originally Posted by rozeel
Hi,

I would like to do the same but....

where should i place this script to automate its autostart?

TIA

Ronald

In /Library/StartupItems, i.e. Library -> StartupItems, but not the Library in your home folder but the Library at the Computer level (where there is also a Systems folder and the Applications folder.)

Dale

ulrichm 06-14-2004 02:44 AM

Quote:

Originally Posted by rozeel
where should i place this script to automate its autostart?

Or open your System Preferences > Accounts >Your Account and click on the tab of "Startup Items". Here you can just drag and drop it into. You can also change the order of when to startup.

rozeel 06-14-2004 04:41 AM

Okay.. I will try it tonight...

What kind of script language is this?

Thanks!

Ronald

ulrichm 06-14-2004 04:48 AM

Quote:

Originally Posted by rozeel
What kind of script language is this?

It is an AppleScript. You need to launch the AppleScript Editor and paste the script into it and save it compiled.

rozeel 06-27-2004 06:09 PM

Hi again, i tried and made an prober applescript. My first one. Whe i run it in the scripttool it works!

When i drag and drop it in the startup lines in the system settings. Well it stars but in the script tool, i would like to run it and that it closes.

Is there a way to acomplish this?

TIA

Ronald

ulrichm 06-28-2004 06:27 AM

You need to save it as a compiled application. File -> Save As -> Application.
Then you can drag this application into the StartupItems.

bluehz 06-28-2004 08:06 AM

No need for this script. Simply mount the SMB you want to auto-mount. Make sure a window is opening showing the root level of the SMB mount, then drag the icon at the TOP OF THE WINDOW into your SysPrefs > Accounts > StartupItems.

Some people have recommended doing this just dragging the icon off the desktop, etc - but I have never had any luck with anything but the icon at the top of the actual SMB mount window. I use this same technique to mount 3 SMB's and 2 DAV mounts from my Linux server at every start. Has worked flawlessly for over 6 months.

rozeel 06-28-2004 09:12 AM

okay so i can mount the smb mounts with the script and then drag drop the icons of the shares from my desktop to the startup list?

bluehz 06-28-2004 09:17 AM

Quote:

Originally Posted by rozeel
okay so i can mount the smb mounts with the script and then drag drop the icons of the shares from my desktop to the startup list?

No need to use the script at all. Just mount SMB's manually the first time. Use Finder > Connect to server.

bbusschots 09-29-2004 01:10 PM

OK I've tried everything here and I cann't get it to work. I'm obviouisly badly misunderstanding something. Can some one please explain how to do this as a simple set of steps (pretend I know about as mush about computers as your Gran!). If it makes any odds I'm running a G4 with OS 10.3.5.

Thanks a million,

Bart.

Las_Vegas 09-29-2004 04:24 PM

First time:

1) From Finder, select Go:Connect to Server…

2) Enter drive's Server IP address. If you don't know it, select Browse to attempt to find it.

3) Enter User Name and Password. If you wish it to remember your password when you're logged into this Mac, Click "Options…" and check "Add Password to Keychain."

4) If drive supplies more than one shared drive, select the drive from the next window.

5) once the drive is mounted, drag the icon to your dock, next to the Trash. In the future, you can just click the icon in your dock to mount it.

Gnarlodious 10-02-2004 08:47 PM

Wrong StartupItems info
 
Quote:

Originally Posted by Dale Mox
In /Library/StartupItems, i.e. Library -> StartupItems, but not the Library in your home folder but the Library at the Computer level (where there is also a Systems folder and the Applications folder.)

I feel compelled to correct you, StartupItems is for shell scripts, Applescripts won't run in there unless in a shell wrapper.
You mentioned it twice, or I would have thought it a simple mistake.

-- Gnarlie's Applescript page:
http://Gnarlodious.com/Apple/AppleScript/

w_grace 11-10-2004 04:35 AM

I assume all this works for AFP connections and any types of shares. What is the best way to connect to a Windows Box that is sharing anyway?

What whould you guy suggest?

Raven 11-10-2004 12:38 PM

I don't knwo what I'm doing thats different, but unless I use the script app (which I've been using with success for smb mounts for while now) it will not mount. I tryied to put the Top window icon in my Startup Items for my account : no mount. If it put the icon on the Dock, nothing either, etc...
Also a little comment... the GUI FTP client in Panther is agravating ! It will not show items that are on a Novell drive at all ! Just an empty folder :mad: Was hoping that the 10.3.6 update would fix this long standing issue, but alas... Guess I'll have to wait for Tiger for a fix. :eek:

Gnarlodious 11-11-2004 12:31 AM

notoriously intermittent
 
Truth be told, I find networking with XP to be notoriously intermittent. Sometimes XP takes 15 minutes to recognize the Mac. I really don't think there's any reliable way to to SMB unless your machines are always connected. :mad:

Raven 11-11-2004 10:36 AM

Mine is very reliable once the connection is activated... I simply put the SMB share mounting script in the Startup tab of my User account (I second what Gnarlodious said about /Library/StartupItems... any AppleSrcipt should be in the Account's Startup items tab) and it works like a charm each and every time. Never unmounts or hang and I'm using no special settings. I found that what's unreiable is when you try to use other mount methods than with a script... Never seems to be able to resolve the fact that a mount called My Documents actually is /my.pc.ip.adress/My Documents... which is why dragging to the Dock startup items or any other does not work... at least in my case.
I don't complain though... Made me discover scripting and now I'm having lots of fun with it, and don't have to touch anything to mount my PC drive :D

ulrichm 11-11-2004 11:23 AM

I have to second what Raven said. I have not had any problems with the script in my Startup items tab. I do not connect to a Wintel box but a Linux box.
If I could wish for a new feature in Tiger is a built in auto connect to networked folders. ;-) (hint understood Apple?)

Dallasplowboy 11-12-2004 05:55 PM

SMB share mounted via AD server to OSX client during login
 
Ok, I've got one...

How do you mount an SMB share via Active Directory to a Mac OSX.3.6 client during login? I know I could manually mount and copy into startup on local machine, or run an Applescript locally, but I would like to either utilize a script (PERL?) hosted from the AD server for ALL Mac accounts to utlitize or configure via AD Users and Computers directly.

Any help would be appreciated...
Thanks!

dumphuck 02-07-2005 12:23 AM

connecting to a sub directory
 
ok i have a question on this thread.

i compiled a script (as above) to connect to a win2003 volume, but i am also needing to connect a second volume which is a users directory, which requires the script to connect me directly to a sub directory, and not to the root. the root is locked down to everyone but admin's, but everytime i try and run

mount volume "SMB://<WORKGROUP>;<USER>:<PWD>@<SERVER>/<SHARE>/<USERS DIR>"

it fails.

any suggestions?

dukeinlondon 08-18-2005 04:32 AM

:eek: Is any of this improved in 10.4 ?

Raven 08-18-2005 09:06 AM

Is the Share on AD or on a Windows 2003 server ? If so check with your Admins to see if they are using DFS, which is a file system that is layed on top of the NTFS partition... This path system is not compatible with the SMB on Panther or Tiger for now (only the newest version of Samba for Linux and Unix supports this and it has not been re-compiled for Mac yet)... If this is the case, you would have to get from your admins the real path to the file, and not the DFS one. Also, a little trick if ytou have a PC as well that has that drive mounted, check its properties and you will have in there the original file path as well ast the DFS one.


All times are GMT -5. The time now is 08:58 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.