To be honest I don't expect a satisfying answer here.These command cannot be called and that's it (as far as I know the only commands that cannot be used with call).
Here are few examples with their output:
C:Windowssystem32>call @if a==a echo called
',' is not recognized as an internal or external command,
operable program or batch file.
C:Windowssystem32>call (@if a==a echo called)
';' is not recognized as an internal or external command,
operable program or batch file.
C:Windowssystem32>call if a==a echo called
'if' is not recognized as an internal or external command,
operable program or batch file.
C:Windowssystem32>call for %a in (1) do @echo called
'for' is not recognized as an internal or external command,
operable program or batch file.
C:Windowssystem32>call @for %a in (1) do @echo called
'+' is not recognized as an internal or external command,
operable program or batch file.
C:Windowssystem32>call (@for %a in (1) do @echo called)
';' is not recognized as an internal or external command,
operable program or batch file.
I have some suspicious , that IF and FOR are not in fact 'real' commands - they just decide to pass the command prompt control to the line (or brackets block) behind them or not , which confuses the call.
Anyway even that , when there are syntax errors in called FOR or IF they are detected:
C:Windowssystem32>call (@if a= echo called)
= was unexpected at this time.
C:Windowssystem32>call (for %a (1) do echo called)
(1 was unexpected at this time.
So at least the parsing is done.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…