Correct Testing Precedence of Batch File ERRORLEVELs (39585)
The information in this article applies to:
- Microsoft MS-DOS operating system 2.11
- Microsoft MS-DOS operating system 3.1
- Microsoft MS-DOS operating system 3.2
- Microsoft MS-DOS operating system 3.21
- Microsoft MS-DOS operating system 3.3
- Microsoft MS-DOS operating system 3.3a
- Microsoft MS-DOS operating system 4.0
- Microsoft MS-DOS operating system 4.01
- Microsoft MS-DOS operating system 5.0
- Microsoft MS-DOS operating system 5.0a
- Microsoft MS-DOS operating system 6.0
- Microsoft MS-DOS operating system 6.2
- Microsoft MS-DOS operating system 6.21
- Microsoft MS-DOS operating system 6.22
This article was previously published under Q39585 SUMMARY
When you use multiple IF ERRORLEVEL statements in batch files, the order in
which the ERRORLEVELs are tested numerically is important. The correct
order is descending (highest to lowest). This ordering is from the way
ERRORLEVELs are tested. The IF condition is set to TRUE when the ERRORLEVEL
is equal to, or greater than, the ERRORLEVEL number.
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | KB39585 |
---|
|