Loop example in cmd window

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
 
M

Matthias Tacke

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)
 
J

Jerold Schulman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top