@foone IIRC the batch for
command isn't a loop in the usual sense. It first builds a list of input strings (in various ways, depending on how you invoke for
), then uses the "loop body" as a template string to replicate and substitute the current input string into (mail merge style). Finally, it takes the "loop bodies" with input values interpolated into them, concatenates them all, and evals the result.
This has certain implications for performance, loop control, and the way regular %variables%
work in these "loops".