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

  1. 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
    1. jays33
       
      Thank you for your help.
      Where do I place an order?
      1
    2. 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
    3. m.ehdii33
       
      Can I send you my order by private message?
      I'm having a bit of trouble :)
      1
    4. 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
  2. dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   5 660
     
    bonjour
    for /L %%a in (1,1,100000) do @echo %%a
    2