batch file - How to create a .bat loop that creates a new cmd window and runs a different loop/function? -


i have following code:

set cont=3 :window  start segredo.bat  if %cont% equ 0 goto windowend set /a cont=cont-1  goto window :windowend  :loopstart echo spam goto loopstart :loopend 

my objective open 3 cmd windows , run echo spam loop in each 1 of them. instead, start opening infinite cmd windows without running loopstart. i'm kind of new bat language there can me?

for /l %%a in (1 1 3) start "" cmd /q /c"for /l %%b in (0) echo spam" 

inside out

  • an infinite loop needed echo, numeric for /l loop used. "iterate 0 1 in steps of 0", for /l %%b in (0 0 1) abreviated.
  • as 3 separate instances required, command placed inside cmd instance
  • we use aditional numeric for /l loop, start each of cmd instances. prevent problems commands, start command handles first quoted argument window title, pair of empty quotes included.

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -