; It doesn't hurt to make sure the C:\temp folder exists MD "C:\temp" ; Redirect messages to a log file, display ; a message dialog if redirection fails If RedirectOutput( "C:\temp\login.log", 1 ) <> 0 $Msg = "Error logging the results.@CRLF" $Msg = $Msg + "Please notify the helpdesk.@CRLF" $Msg = $Msg + "For now, results will be displayed on screen." $RC = MessageBox( $Msg, "Log File Error", 64, 300 ) EndIf $Error = 0 ; Map drive G: to the department share USE G: "\\CompanyServer\Dept" If @ERROR <> 0 "Error @ERROR while trying to map drive G:@CRLF" $Error = $Error + 1 EndIf ; Map drive H: to the user's home share USE H: "\\CompanyServer\@HOMESHR" If @ERROR <> 0 "Error @ERROR while trying to map drive H: to the homedir@CRLF" $Error = $Error + 1 EndIf ; List all mappings USE List ; End redirection $RC = RedirectOutput( "" ) ; Warn the user if (an) error(s) occurred If $Error > 0 $Msg = "$Error error(s) occurred during login.@CRLF" $Msg = $Msg + "The errors are logged to be " $Msg = $Msg + "reviewed by the helpdesk staff.@CRLF" $Msg = $Msg + "Please notify the helpdesk.@CRLF" $RC = MessageBox( $Msg, "Login Error", 64 ) EndIf