Here are the exit codes returned by the PRSMon when run with a command-line parameter.
Exit Code |
Description |
0 |
The command completed successfully. |
1 |
An error occurred during command execution. |
2 |
The user canceled command execution. |
3 |
The command timed out waiting for users to logoff. |
4 |
Another instance of the application was already running. |
5 |
The PRSMon was passed an illegal command-line parameter. |
When a program is closed it sets an exit code number that can be used by the application that launched it to gauge the program's success or failure. Most Windows scripting and scheduling tools execute programs asynchronously (wait for them to finish so the program's exit code can be read and reported or acted upon), however Windows DOS Prompt execution does not.
To execute PRSMon synchronously from a batch file use the Windows start command with the /wait command option. The following example shows execution from the DOS Prompt using start. The exit code can be tested with the DOS if batch command.
C:\> start /wait p:\prs2k_data\prsmon /disable
C:\> if errorlevel 1 echo Error!