我編寫了一個AppleScript應用程序,它運行「mount -t smbfs」命令來掛載我們員工使用的Windows共享驅動器。通過AppleScript掛載SMB驅動器
該應用程序已成功使用了幾個月,直到今天。如果用戶的密碼中有@符號,則應用程序失敗。路徑被拒絕。
這裏的腳本:
-- Teaching Drive Access
--Get The Shortname and PC Password of current user
--set PCusername to (short user name of (system info))
set PCusername to "benstaff"
--set PCPassword to text returned of (display dialog "What's your PC Password?" default answer "" with title "T Drive" with icon stop with hidden answer)
--Create Sharepoint on Desktop
set FolderTarget to (path to desktop folder as text) & "DoNotUseTeachingDrive"
try
FolderTarget as alias
on error
do shell script "mkdir /Users/" & PCusername & "/Desktop/DoNotUseTeachingDrive/"
end try
set mountcommand to "mount -t smbfs "
set mountuser to "//" & PCusername & ":" & PCPassword
set mountuser to "//" & PCusername & ":" & PCPassword
set mountvolume to "@ncs-srv-fs3.ncs.local/Teaching"
set machomepath to "/Users/" & PCusername & "/Desktop/DoNotUseTeachingDrive/"
set mountwindowshome to mountcommand & mountuser & mountvolume & " " & machomepath as string
do shell script mountwindowshome
的mountwindowshome
的完整輸出:
mount -t smbfs //mystaff:[email protected]@ncs-srv-fs3.ncs.local/Teaching /Users/mystaff/Desktop/DoNotUseTeachingDrive/
如果我運行在終端的命令沒有密碼問我密碼和共享正確安裝。
任何幫助/指針將受到感謝。
看起來問題在於您的密碼。這個'@@'吹掉了你Mac的頭腦。 –