Loop example in cmd window

  • Thread starter Thread starter Vanessa Berger
  • Start date Start date
V

Vanessa Berger

Hi,

Can anyone send me an example of a loop in command prompt?
I need to execute a command called batch.exe many times, and would like to
do it in a loop.

Thank you,
Vanessa
 
Vanessa Berger said:
Hi,

Can anyone send me an example of a loop in command prompt?
I need to execute a command called batch.exe many times, and would like to
do it in a loop.

Thank you,
Vanessa
Hello Vanessa,

see help of for /?

for /L %a in (1,1,10) do @(echo run %a&batch.exe)

will run 10 times (start,step,stop)
 
Hi,

Can anyone send me an example of a loop in command prompt?
I need to execute a command called batch.exe many times, and would like to
do it in a loop.

Thank you,
Vanessa

:loop
batch.exe
if "%some_variable%" EQU "Some_value" goto loop


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top