Only First 8 Characters in a Batch Label Recognized

This article was previously published under Q63071
This article has been archived. It is offered "as is" and will no longer be updated.
Summary
MS-DOS recognizes only the first eight characters of a batch file label;subsequent characters are ignored.

NOTE: This eight-character limitation also applies to the %config% variablepassed to the AUTOEXEC.BAT file in MS-DOS versions 6.0 or later when youuse multi-boot configurations.

For example, the labels LATESTCHANGE and LATESTCHANGES are identical to MS-DOS. The line "GOTO LATESTCHANGE" (without the quotation marks) transfersto the first label in the file that has same first eight characters asLATESTCHANGE.
More information
The following examples illustrate this limitation.

Example 1

The following example
goto latestch
: latestchanges
echo two
: latestch
echo three
displays the following
two
three
rather than displaying the following:
three

Example 2

The following example
:latestch
echo zero
:latestchanges
echo one
goto latestchanges
displays the following until CTRL+C is pressed, terminating the batchfile:
zero
one
zero
one
zero
one
etc.
6.22 4.01 5.00 5.00a 6.00 6.20 multiboot
Properties

Article ID: 63071 - Last Review: 10/26/2013 12:59:00 - Revision: 3.0

  • Microsoft MS-DOS 5.0 Standard Edition
  • Microsoft MS-DOS 6.0 Standard Edition
  • Microsoft MS-DOS 6.2 Standard Edition
  • Microsoft MS-DOS 6.21 Standard Edition
  • Microsoft MS-DOS 6.22 Standard Edition
  • kbnosurvey kbarchive KB63071
Feedback