Article ID: 81819 - View products that this article applies to.
This article was previously published under Q81819
Several MS-DOS commands set a value detectable using the IF ERRORLEVEL command. These values are called "errorlevels," "return codes," or "exit codes." These commands are:
Any program in the MS-DOS environment can set an exit value that can be detected with IF ERRORLEVEL. Any MS-DOS command can return a value, but only the above commands have exit codes defined in the MS-DOS specifications. Return values from other commands should not be relied upon, as they may be different for different versions and dialects of MS-DOS.
None of the internal MS-DOS commands have defined return codes. An external command is a separate MS-DOS program; internal commands are contained within COMMAND.COM and are always available for use when the MS-DOS prompt is active.
You can determine if a command is internal or external by checking your MS-DOS documentation. In MS-DOS 5.0 and 5.0a, commands are marked as internal or external in the chart that accompanies each command in Chapter 14 of the "Microsoft MS-DOS User's Guide and Reference" manual. Earlier versions of the manual include a boxed E or I symbol on the upper outside corner of the page to denote external or internal.
Customers have suggested that exit codes be defined for all appropriate MS-DOS commands (both internal and external). This feature is under review and will be considered for inclusion in a future release.
Article ID: 81819 - Last Review: November 16, 2006 - Revision: 2.1