6.3 Retrieving application exit codes

6.3.1 Displaying exit codes

You can display the list of exit codes by running the following at the command line:

MyIDApp.exe /err

Note: Not all codes listed are currently used. Some codes relating to previous versions of the Self-Service App will not appear.

To view the exit code from the last run of the application, in a batch file include the following:

echo %errorlevel%

In PowerShell, you can use $LASTEXITCODE.

6.3.2 Batch files

If you execute the app from a Windows batch file, you can capture the application exit codes and display them to the user.

For example, copy the following text into a .bat file:

@echo off

start /wait MyIDApp.exe /w /un:"Simple User" /pw:"pass1" /pw:"pass2"

echo Exit Code: %errorlevel%

You can use the tables in section 6.1, Success exit codes and section 6.2, Failure exit codes to determine the meaning of the code and display this to the end user; for example:

@echo off

start /wait MyIDApp.exe /un:"Simple User" /pw:"pass1" /pw:"pass2"

IF %errorlevel% EQU 0 (echo Exit code 0 OK )

IF %errorlevel% EQU 1 (echo Exit code 1 No jobs available )

IF %errorlevel% EQU 2 (echo Exit code 2 Closed by other instance )

IF %errorlevel% EQU 101 (echo Exit code 101 An error occurred, please refer to your documentation to enable logging )

IF %errorlevel% EQU 102 (echo Exit code 102 Device is already issued )