This is a parser error when trying to interpret a string
for /f %%
Try it (it does not work)
for /f %%
And now with
set "') do echo =') do echo %%" for /f %%
edited after some test, it seems that the problem is not with the for command, but with the search for the right closing parenthesis, which ends with improper error handling, which discards all commands processed inside an open code block.
This batch file (all these are lines)
if 1==1 ( for %a in (test) do echo %%a
will fail with a syntax error ( %a ) indicating that the parser is processing it, but if the error is fixed
if 1==1 ( for %%a in (test) do echo %%a
the party ends without errors
Just a simple batch like this, without the difference of an if or for analyzer, behaves the same
( echo test
MC ND source share