I think two issues block the functionality (you want).
- By using echo all the remaining of the line will be printed (even if you get the loop working).
- Working with labels requires the use of script file(s). You can't use labels in the console. (I mean interactively: try it, enter a
:label, enter some other lines and than enter goto label. Then you won't get into a loop!)
When I use for caller.cmd:
for /l %%x in (1, 1, 10) do (
start cmd /c test.cmd
)
and for test.cmd:
:up
echo loop
goto up
it works (at least for me ...)
Even when I use for test.cmd:
:up
echo loop && goto up
it works. But than each console will show loop && goto up in stead of loop!
While I was writing this down, Martyn had already given a likewise answer. Maybe that's convincing enough for you.