I was wondering about the maximum length of a label in a batch file.
I found this Microsoft article stating:
MS-DOS recognizes only the first eight characters of a batch file label; subsequent characters are ignored.
They also provide an example :
@echo off
goto latestch
:latestchanges
echo two
:latestch
echo three
which is supposed to output
two
three
instead of
three
But on my system, I get
three
I tried on Windows 7 (6.1.7600) and WindowsXP (5.1.2600), and get the same result on both of them.
It looks to me there is no eight characters limitation!
Am I missing something?
The limits are 2047 and 8192, depending on your OS. See this KB article.