function graphical400($drive,$share,$server)
Dim $choice,$400username,$400password,$passlen,$userlen,$count
$count=0
$userlen=0
$passlen=0
if exist("$drive")
? "You already have"+$drive
else
$share=$server + $share
? "mapping $drive to $share"
$choice = MessageBox("Do you want to map "+$drive+" to "+$share+"?", "AS400 Drives", 36)
If $choice = 6 ;6=yes to question
while ($400username=@CRLF|$userlen=0)
cls
color y+/n
? "Please enter your AS400 Username"+@CRLF
color g+/n
GETS $400username
$userlen=len($400username)
loop
while ($400password=@CRLF|$passlen=0)
cls
color y+/n
? "Please enter your AS400 Password"+@CRLF
color g+/n
GETS $400password
$passlen=len($400password)
loop
Use $drive /Delete
if @ERROR <> "2250"
error_check(@ERROR,@SERROR,"failed to remove $drive drive")
endif
Use $drive $share /user:$400username /password:$400Password
error_check(@ERROR,@SERROR,"failed to map $drive drive")
endif
endfunction