[MacTUG] Mapping a Network Drive at Login

Donald Duff-McCracken dsmccrac at uwaterloo.ca
Mon Mar 5 15:35:01 EST 2012


Hi Lowell

If they are your users, then you they will all presumably be using the fileu.uwaterloo.ca server, so they do not need to use Guillermo's fancy script (that would be useful in a lab where you may have folks wandering in that have N drives located all over the place.

So just try a script more basic, like his more basic on or one based on what I did.

I just took my script and changed it --I should do so anyhow as we are also moving to File U and here it is. (OK, I am just a bit too rude, or does "FileU" sound like you are swearing at someone. Maybe it is just having a 15 year old son that does it, but I am betting that a bunch of teenage students will titter at this name.

Anyhow, this seems to work…
tell application "Finder"
activate
set UserName to (do shell script "whoami")
try
mount volume "smb://" & UserName & "@fileu.uwaterloo.ca/users$"
on error
display dialog "Sorry, " & UserName & ", but I cannot mount your Network Drive."
end try
try
if not (item (UserName & "'s Network Drive") of the desktop exists) then make new alias file to folder UserName of disk "Users$" at desktop with properties {name:UserName & "'s Network Drive"}
end try
end tell

Modding Guillermo's would work too but I just did it to mine.

A few Pss:
PS: Remember that you can save it as a compiled app so that users can just double click it
PS2: I only use this script as a backup as I get the share to mount automatically as previously discussed.

don

------------------------------------
Donald Duff-McCracken
Technical Services Manager
Mapping, Analysis & Design
Faculty of Environment
University of Waterloo
(519) 888-4567 x32151
http://www.environment.uwaterloo.ca/computing/people/don.html
------------
To request help from MAD please us Request Tracker. For info see: http://www.environment.uwaterloo.ca/computing/faculty_staff/ <http://www.fes.uwaterloo.ca/computing/faculty_staff/>
------------
This email communication is intended as a private communication for the sole use of the primary addressee and those individuals listed for copies in the original message. The information contained in this email is private and confidential and If you are not an intended recipient you are hereby notified that copying, forwarding or other dissemination or distribution of this communication by any means is prohibited.  If you are not specifically authorized to receive this email and if you believe that you received it in error please notify the original sender immediately.






On 12-03-05 2:30 PM, "Lowell Williamson" <llwillia at uwaterloo.ca<mailto:llwillia at uwaterloo.ca>> wrote:

Because we aren't doing the golden-triangle, the script won't pass the username. I tried setting the username in the script,

set UserName to "llwillia"

but no luck... can I get some help?
Thanks.

--
Lowell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uwaterloo.ca/pipermail/mactug/attachments/20120305/271c664c/attachment.html>


More information about the MacTUG mailing list