But I can nest the if EXIST's:
if EXIST file1 (if EXIST file2 echo Both There)For the ELSE, it gets more complicated:
if EXIST file1 (if EXIST file2 (echo Both There) ELSE echo Nope)Will echo Nope if file1 exists and not file 2, but not if file2 exists but not file1. So you need:
if EXIST file1 (if EXIST file2 (echo Both There) ELSE echo Not 2) ELSE echo Not 1That will tell you either "Both There", or "Not 1" if only file1 isn't, or "Not 2" if only file2 isn't.
No comments:
Post a Comment