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).

  1. by using echo remaining of line printed (even if loop working).
  2. 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 goto label. 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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -