logging into smb

I have setup a script that mounts a smb share point. The user only gets one chance to type the password then it quits with a “AppleScript Error” Network file permission error" Is there a way to just go back to the mount smb part to have them try again.

code:

tell application “Finder” to set disk_mounted to (exists disk “Home”)
if disk_mounted then
do shell script “/Users/user”
else
mount volume “smb://url/home”
do shell script “/Users/user”
end if

Hey

I’ve done it is a slightly other way.
Mayby it can help you

(*

// ScriptName:
// Path:
// Build:

// Created by Van Tongelen Johannes
// Copyright (c) 2004

Script usage:
Mount of Shares on Server with error handlers

Variable used:

In Comming Attributes:


*)
property FirstTryPWD : true

tell application “System Events”
set user_name to name of current user
set pass_word to “xxx”
end tell

set FirstTryPWD to true


– mount PDF_Workflow

try
mount volume “smb://” & user_name & “:” & pass_word & “@[your.domainname].com/PDF_Workflow”
on error e number n
beep
–return n
if n = -55 then
display dialog “PDF_Workflow already mounted” buttons {“Ok”}

else if n = -5000 then
	set FirstTryPWD to false
	display dialog "Wrong passwoord" buttons {"Ok"}
else
	display dialog "Error: " & n & " " & e buttons {"Ok"}
end if

end try