6

I want a batch script which opens up multiple command prompt on a single click and runs the same command over and over again . i have written a below code which only opens an single command prompt and stops there .is there a way to do the same.

   for /l %%x in (1, 1, 5) do (
    start cmd /c 
    cd / && dir /s
   )
npocmaka
  • 55,367
  • 18
  • 148
  • 187
Santhosh Pai
  • 2,535
  • 8
  • 28
  • 49

1 Answers1

21
   for /l %%x in (1, 1, 5) do (
    start cmd /c "cd / && dir /s && pause"
   )

It opens different command prompts ...

npocmaka
  • 55,367
  • 18
  • 148
  • 187
  • it just opened the command prompts but its not running the commands – Santhosh Pai Jul 18 '13 at 04:37
  • 2
    it should be `start cmd /c "cd \ & dir /s & pause"` so that newbies aren't confused. – foxidrive Jul 18 '13 at 08:42
  • start /min cmd /c batch1.bat && start program1.exe start /min cmd /c batch2.bat && start program2.exe https://superuser.com/questions/505077/batch-file-to-open-multiple-cmd-prompts# – Karan Kaw Jul 02 '17 at 06:30