tangerine27
asked on
Wildcard with IF EXIST doesn't work
Hi,
I want to get a batch file to continue if .txt files exist in the specified directory.
I tried this:
IF EXIST c:\test\*.txt GOTO END
<rest if batch file>
:END
But this ran all the commands without .txt files.
Please could someone tell me how to do this?
Cheers,
I want to get a batch file to continue if .txt files exist in the specified directory.
I tried this:
IF EXIST c:\test\*.txt GOTO END
<rest if batch file>
:END
But this ran all the commands without .txt files.
Please could someone tell me how to do this?
Cheers,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
IF NOT EXIST c:\test\*.txt GOTO :END
<rest if batch file>
:END
<rest if batch file>
:END
tangerine27, any news?
what happens if you try?
if exist c:\test\*.txt dir c:\test\*.txt