Article ID: 39627 - Last Review: November 26, 2003 - Revision: 3.0 MS-DOS: Batch File Labels Are Not Case SensitiveThis article was previously published under Q39627 SUMMARY
The labels of batch files, which are interpreted with the MS-DOS
COMMAND.COM command interpreter, are not case sensitive. For example,
the following labels, as well as any other capitalization
combinations, are equivalent:
:ONE
This is because the command processor converts all label characters to
uppercase to resolve label references when it processes a batch file.
:One :one MORE INFORMATION
In the following batch file, the labels "TWO" and "Two", as well as
"End" and "END" are interpreted as the same label:
if %1 == one then goto :TWO
The following batch file executes the first occurrence of the
label, disregarding the capitalization of that label:
goto END :Two echo One Testing. :End
@echo off
Even though the label in the second line is lowercase, the batch file
executes the first occurrence of the label. The output of the batch
file, if invoked with "one" as the first parameter, would be as
follows:
if %1 == one goto test1 goto END :TEST1 echo Test 1 goto END :test1 echo Test 2 :End echo DONE!
Test 1 DONE! APPLIES TO
| Article Translations
|

Back to the top
