You are currently offline, waiting for your internet to reconnect

MS-DOS: Batch File Labels Are Not Case Sensitive

This article was previously published under Q39627
This article has been archived. It is offered "as is" and will no longer be updated.
The labels of batch files, which are interpreted with the MS-DOSCOMMAND.COM command interpreter, are not case sensitive. For example,the following labels, as well as any other capitalizationcombinations, are equivalent:
This is because the command processor converts all label characters touppercase to resolve label references when it processes a batch file.
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
goto END
echo One Testing.
The following batch file executes the first occurrence of thelabel, disregarding the capitalization of that label:
@echo off
if %1 == one goto test1
goto END
echo Test 1
goto END
echo Test 2
echo DONE!
Even though the label in the second line is lowercase, the batch fileexecutes the first occurrence of the label. The output of the batchfile, if invoked with "one" as the first parameter, would be asfollows:
Test 1
3.20 3.21 3.30 3.30a 4.00 4.01 5.00

Article ID: 39627 - Last Review: 12/04/2015 09:03:15 - Revision: 3.0

Microsoft MS-DOS 3.1, Microsoft MS-DOS 3.2 Standard Edition, Microsoft MS-DOS 3.21 Standard Edition, Microsoft MS-DOS 3.3 Standard Edition, Microsoft MS-DOS 3.3a, Microsoft MS-DOS 4.0 Standard Edition, Microsoft MS-DOS 4.01 Standard Edition, Microsoft MS-DOS 5.0 Standard Edition

  • kbnosurvey kbarchive KB39627