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:
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:email@example.com@myhost/sharedfolder1" end try end tell
Can anybody tell how I should configure my script to get it working?
One of these solutions might work (no access to a Mac at the moment):
Escape the first
mount volume "SMB://myuser:firstname.lastname@example.org@myhost/sharedfolder1"`
Play with the quotes. Try
mount volume "SMB://myuser:'email@example.com'@myhost/sharedfolder1"
mount volume 'SMB://myuser:"firstname.lastname@example.org"@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
email@example.com which, unless I am missing something obvious, seems silly.
The standard way of encoding
@ in URLs is using URL-encoding, which results in
@ is ASCII 40h) – so use
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