login script to mount smb shares

hi guys i have been searching for days to achieve what im after and im hoping someone here can help me out…

i have an imac on win 2003 domain running leopard 10.5.1 and i have managed to join it to the domain.

i need to create a script (applescript i think) that will run at login and connect to about 8 shares

i have this so far…

tell application "Finder"
	open location "smb://serverIP/shareName"
end tell

and it works great! but theres a few issues, when you connect to the share a window pops up in your face and while its not to bad on its own but when you have say 8 shares it just doesn’t look good at login.

is there a way to connect to the share then immediately close the window? for example

tell application "Finder"
	open location "smb://serverIP1/shareName1"
        close window
        open location "smb://serverIP2/shareName2"
        close window
        open location "smb://serverIP3/shareName3"
        close window
end tell

also where abouts would i be able to store this script on the mac so that it runs as soon as the user logs in?

i cant store it in system preferences>accounts>user>login items because its a school with over a 1000 students

any help would be awesome, thanks

Hi,

try this instead, it doesn’t open any window


mount volume "smb://serverIP1/shareName1"
mount volume "smb://serverIP2/shareName2"
mount volume "smb://serverIP3/shareName3"

thanks heaps! worked a treat! you dont know where i could store this script to run for all users at login would you?

I would recommend to Create a LoginHook with a native shell script,
which should create the mount points and mounts the shares with the mount or mount_smbfs command.