How to open a cmd with a command a certain amount of times

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How to open a cmd with a command a certain amount of times



I have a cmd opening with a certain command and want it to duplicate the amount of times that they type.




1 Answer
1



Type inside the batch script myscript.bat:


myscript.bat


@echo off
for /L %%i in (1,1,10) do (
echo.%%i
)



This will print 1..10 numbers.



For details type inside console window: for /?


for /?



If you want open separate console on each iteration:


@echo off
for /L %%i in (1,1,10) do (
start "" "%COMSPEC%" /C "echo.%%i&pause"
)






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived