tags:

views:

40

answers:

1

Hi, I want to make something like this...

:LoopBegin

if ???? goto End

some other work goes here*

gotoLoopBegin

:End

The "????" part should be a check that a file exists with the name "exit.txt" for example. If such a file exists in the current folder, I want the batch file to just exit. Is there a way to do this?

Thanks

+1  A: 
if exist filename goto End

See if /? from a command prompt for more details of what is possible. Also notice goto :EOF will always goto the end, without needing an explicit label.

Richard