Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a script in OS X which is something like this:

tell application "Finder"
    try
        mount volume "SMB://myuser:mypwd@myhost/sharedfolder"
    end try
end tell

It works fine, but now there is an additional share with the credentials like so:

myuser1@mydomain.com 

If I add the following line to the script, it fails:

tell application "Finder"
    try
        mount volume "SMB://myuser:mypwd@myhost/sharedfolder"
        mount volume "SMB://myuser:myuser1@mydomain.com@myhost/sharedfolder1"
    end try
end tell

Can anybody tell how I should configure my script to get it working?

share|improve this question
1  
What scripting language? If you want an answer you must specify where the problem is found. Perhaps this is obvious to Mac owners (AppleScript?), but to me It seems like relevant info to include. –  Ярослав Рахматуллин Mar 14 '13 at 16:20

3 Answers 3

One of these solutions might work (no access to a Mac at the moment):

  1. Escape the first @

    mount volume "SMB://myuser:myuser1\@mydomain.com@myhost/sharedfolder1"`
    
  2. Play with the quotes. Try

    mount volume "SMB://myuser:'myuser1@mydomain.com'@myhost/sharedfolder1"
    

    or

    mount volume 'SMB://myuser:"myuser1@mydomain.com"@myhost/sharedfolder1'
    

Are you sure you need to specify the domain? Don't see why of the first mount succeeds. Unless the actual username is myuser1@mydomain.com which, unless I am missing something obvious, seems silly.

share|improve this answer

The standard way of encoding @ in URLs is using URL-encoding, which results in %40 (@ is ASCII 40h) – so use myuser%40mydomain.com.

share|improve this answer

You can gain access to the SMB share by specifying your Windows login and the machines IP address like this:

mount -t cifs -o username=winuser,password=winpass //192.168.0.105/myshare /mnt/share
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.