Batch that will run only if another file exists.
Moderator: DosItHelp
Batch that will run only if another file exists.
Hi,how to make a batch file that will run only if another file will exist? I think it should be something like IF ELSE but i dont know how to make it.Example : when i run file "batch.bat" and if file "aaaa" (without any extension) will be in same folder as the batch.bat file will run and go to :MENU,but when there will not be "aaaa" file,it will show text "COULD NOT FIND 'aaaa' ABORT."
Re: Batch that will run only if another file exists.
Code: Select all
@echo off
if not exist "aaaa" (
echo COULD NOT FIND 'aaaa' ABORT.
pause>NUL
goto :eof
)
:MENU
echo your stuff here ...
pause
Regards
aGerman