Only First 8 Characters in a Batch Label Recognized

Article ID: 63071 - View products that this article applies to.
This article was previously published under Q63071
Expand all | Collapse all

On This Page

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% variable passed to the AUTOEXEC.BAT file in MS-DOS versions 6.0 or later when you use multi-boot configurations.

For example, the labels LATESTCHANGE and LATESTCHANGES are identical to MS- DOS. The line "GOTO LATESTCHANGE" (without the quotation marks) transfers to the first label in the file that has same first eight characters as LATESTCHANGE.

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 batch file:
zero
one
zero
one
zero
one
etc.

Properties

Article ID: 63071 - Last Review: May 12, 2003 - Revision: 2.0
APPLIES TO
  • Microsoft MS-DOS 4.01 Standard Edition
  • Microsoft MS-DOS 5.0 Standard Edition
  • Microsoft MS-DOS 5.0a
  • 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
Keywords: 
KB63071
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback