Running an infinite loop in multiple command prompts using batch script -
i'm trying write batch script run infinite loop in 10 different command prompts ,but doesn't seem work fine .it opens command prompts , disappears ,i have posted script below please let me know problem.
/l %%x in (1, 1, 10) ( start cmd /c ":up echo loop && goto up" )
i think 2 issues block functionality (you want).
- by using echo remaining of line printed (even if loop working).
- working labels requires use of script file(s). can't use labels in console. (i mean interactively: try it, enter
:label
, enter other lines , enter gotolabel
. won't loop!)
when use caller.cmd:
for /l %%x in (1, 1, 10) ( start cmd /c test.cmd )
and test.cmd:
:up echo loop goto
it works (at least me ...)
even when use test.cmd:
:up echo loop && goto
it works. each console show loop && goto up
in stead of loop
!
while writing down, martyn had given likewise answer. maybe that's convincing enough you.
Comments
Post a Comment