for those who are (still) not on stack overflow.
It appears that most probably CALL uses GOTO to parse the labels (check jeb's answer) .
And for some reason this will print the GOTO help message:
Code: Select all
setlocal
set "label=/?"
call :%%label%%
More interesting it will execute the code bellow the CALL twice.
And will change its command line arguments
try co call this this script with some arguments:
Code: Select all
setlocal
set "label=/?"
call :%%label%% ##
echo -%1-
and without GOTO help message (EDIT on a second tought I dont see anyting special here)
Code: Select all
set l=l
call ::%%l%% ##
:l
echo -%1%-
On the second run it will be changed with ##
Also - it is possible to CALL :EOF with double expansion :
Code: Select all
@echo off
set e=EOF
call ::%%EOF%%
echo something
the thing is you can call any label with double semicolon (not possible with goto on the other hand goto can jump to labels without semicolon but call cant) which fits in the conclusion that CALL uses GOTO. And with double expansion it jumps to :EOF.
And one more side thing:
Code: Select all
set "h=/?"&call rem %%h%%
EDIT
no need of double expansion to call eof - just
Code: Select all
call ::eof