Skip navigation

Mount SMB share

990 Views 4 Replies Latest reply: Jun 11, 2013 5:31 AM by Mr.Do RSS
Mr.Do Calculating status...
Currently Being Moderated
Jun 7, 2013 3:23 AM

Hi,

 

My aim is to create an applescript whereby macbook users can mount their windows home directory. These devices are BYOD so are not connected to the domain.

 

I have had some success but need some assistance from an expert.

 

The script below mounts a volume and the user is able to access their home folder. However, the volume shows the root of the pupilshare$ and I want it to show pupilshare$/username

 

Also, how do I get the finder window to pop up automatically once the volume has mounted, showing their home directory?

 

This is the information from the 'replies' debug window:

 

mount volume "smb://username:password@server/pupilshare$/username"

  --> file "pupilshare$:"

 

 

 

set username to ""

set pass to ""

set server to "server"

set share to "/pupilshare$/"

 

set dialogUser to display dialog "Enter your user name" default answer ""

set the username to the text returned of dialogUser

 

set dialogPass to display dialog "Enter your password" default answer ""

set the pass to the text returned of dialogPass

 

mount volume "smb://" & username & ":" & pass & "@" & server & share & username

 

 

Thanks in advance

 


Mac mini (Mid 2011), OS X Mountain Lion (10.8.2)
  • etresoft Level 7 Level 7 (23,890 points)
    Currently Being Moderated
    Jun 7, 2013 4:49 AM (in response to Mr.Do)

    I am going to have to write a User Tip for this. For now, try using AutoFS instead: https://ssl.apple.com/business/docs/Autofs.pdf

     

    A simpler otption is to mount the drive manually and create a Finder alias to the network drive saving login credentials in the keychain. Then, whenever the alias gets opened, it will mount the network drive.

  • Hiroto Level 5 Level 5 (4,810 points)
    Currently Being Moderated
    Jun 11, 2013 4:18 AM (in response to Mr.Do)

    Hello

     

    Try replacing space with %20 such as My%20Documents.

     

    Good luck,

    H

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.