Quote:

If shell is started ok then @error will be 0 cause kix did what it had to do (launch Shell) and no errors came up.
To get the error codes of a Shell you could use the WSHPipe() UDF.

WshPipe() - Pipes the results of a shell command to an array.




That's not quite correct. If PSEXEC launches, completes and returns an error code (ERRORLEVEL) then @ERROR will be set to the error code.

If you use "RUN" or if the process you start detaches from the controlling process then @ERROR will always be zero as long as the process starts ok.