Batch files - Support of syntax with ending percent sign to access arguments
I noticed on a Windows XP system that in batch files the command-line arguments can be accessed even using a %\d% syntax.
You can verify it for example with this:
@echo off
echo %%1:"%1"
echo %%1%%:"%1%"
if %1==%1% (
echo yes, %%1==%%1%%
)
I wasn't able to find any reference to this thing, the documentation I saw only mentions the %\d syntax.
I'd like to know if it is an official feature (at least on some versions of the command line), an undocumented one or an accidental bug and on which versions of DOS and Windows it works.
EDIT:
I thought that what's happening might also be the result of the interpreter simply ignoring the percent sign, as it does in echo messages.
I don't know if there's a way to verify this hypothesis.