How to make a Windows batch file exit when a file exists in the file structure?
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. I开发者_如何学Gos there a way to do this?
Thanks
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.
精彩评论