Santhosh Pai
Santhosh Pai

Reputation: 2625

batch file to open multiple command prompts and execute the same task

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
   )

Upvotes: 6

Views: 25452

Answers (1)

npocmaka
npocmaka

Reputation: 57252

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

It opens different command prompts ...

Upvotes: 21

Related Questions