Property

Shell.ErrorCode


Warning

This item was deprecated in version 2019r2. Please use Shell.ExitCode as a replacement.

Description

The error code returned by the shell.

Notes

It returns 0 if the Execute method was executed successfully. Otherwise, it returns a system-supplied error code. On Windows, it returns -1 if execution fails.

Sample code

This example checks the value of error code and prints it if it is not zero.

Var sh As New Shell

sh.Backend = TextField1.Text
sh.Arguments = TextField2.Text
sh.Execute TextField3.Text
TextArea1.Text = sh.Result
If sh.ErrorCode <> 0 Then
  MsgBox("The error code is: " + sh.ErrorCode.ToString)
End If

Compatibility

All project types on all supported operating systems.