After each command in question, add:
LMsg('ID', @ERROR, @SERROR)

"ID" should be something that describes the point in your script, like "Line 97".

Then add the LMsg() UDF to your script:
 Code:
Function LMsg($ID, $Err, $SErr)

  Dim $_

  $_ = RedirectOutput('C:\LoginErr.txt')
  'Error ' $Err ' occured at ' $ID ?
  '  ' $SErr ? ?
  $_ = RedirectOutput('')
  Exit $Err  ; exit with same error so @ERROR is not modified by this func
EndFunction


Run your code, then examine C:\LoginErr.log to see what happened. If the log is empty, the cause is bad coding - Kix is throwing an error that is terminating the script at the point of error. You could add a RedirectOutput to the beginning of the script, so all output, including Kix fatal errors, will be in the log. Also, you can try Kix 4.6, which will write fatal errors to the application event log.

Glenn



_________________________
Actually I am a Rocket Scientist! \:D