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
   )

1 Answer 1

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

It opens different command prompts ...

Sign up to request clarification or add additional context in comments.

3 Comments

it just opened the command prompts but its not running the commands
it should be start cmd /c "cd \ & dir /s & pause" so that newbies aren't confused.
start /min cmd /c batch1.bat && start program1.exe start /min cmd /c batch2.bat && start program2.exe superuser.com/questions/505077/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.