How do I make a Windows batch file release when the file exists in the file structure?

I want to do something like this ...

: LoopBegin

if???? goto end

another job is working *

gotoLoopBegin

: End

"????" part should be checking that the file exists named "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

+2


source to share


1 answer


if exist filename goto End

      



See the if /?

command line for more details on what is possible. Also note that goto :EOF

it will always end without requiring an explicit label.

+3


source







All Articles