1 According to the Windows API documentation, error codes with bit 29 set are reserved for application use.

Remarks

This property only represents errors in executing the console application (for example program not found, timed-out, terminated etc.). Errors that occur within the application are not reported via ErrorCode. Console applications usually report such errors via their exit code. The exit code is exposed via the ExitCode property.

To check for application errors, use the constants from the table and AND them with the cAppErrorMask constant. For example: