# Batch File Loop



## Biddlesby (Sep 3, 2003)

How can you program a loop in a batch file?

eg. execute this command 53 times with minimal code:


```
net send 192.168.0.3 Monkey.
```


----------



## Jelley (Aug 31, 2003)

@echo off
:loop
cls
*ENTER **** HERE*
goto loop


----------



## Biddlesby (Sep 3, 2003)

? Could you give me the exact code to repeat


```
net send 192.168.03 Monkey
```
that 53 times?


----------



## Whitestar (Mar 22, 2003)

I believe it would be

@echo off
:loop
cls
net send 192.168.0.3 Monkey
goto loop


----------



## Biddlesby (Sep 3, 2003)

Right...but that repeats the code unlimited times. Is there a way to minimize the amount of times it repeats:

net send 192.168.0.3 Monkey

to a number, such as 53.

And what does it all mean? What is echo and why does it have to be off?


----------



## kiwiguy (Aug 17, 2003)

The "echo off" stops the code being displayed on the screen as it runs.

For a more complete description of all the DOS batch commands, look here:

http://www.computerhope.com/batch.htm#11


----------

