How to repeat a command in batch

Solved
jays33 -  
dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   -
Hello, I would like to repeat a command 100,000 times
a batch program (.bat)
I inserted a loop but it is infinite -_-"
Thank you for your help.

2 answers

Anonymous user
 
Hello,

@echo off
cls
set a=0

:Repeat
echo %a%
set /a a=%a+1
echo %a%
pause
if %a% == 100000 goto Fin
goto Repeat

:Fin
exit

Replace 10 with 100,000 and you're all set

good luck
++
10
jays33
 
Thank you for your help.
Where do I place an order?
1
Anonymous user
 
slt instead of the echo or you add it in the label:Repeat
you can remove the pause it was just for you to see how it works
and put it here:

:Repeat
HERE
set /a a=%a+1
OR HERE
pause
if %a% == 100000 goto End
goto Repeat

++
2
m.ehdii33
 
Can I send you my order by private message?
I'm having a bit of trouble :)
1
Anonymous user
 
No worries…
although I didn’t understand the PM lol
send it in a private message or put it here like this, it could help others
++
0
dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   5 659
 
bonjour
for /L %%a in (1,1,100000) do @echo %%a
2