lundi 30 mars 2015

DOS For if statement to look for file in multiple directories

I'm trying to use the below DOS statement to look for 1st level folders that do not have important.txt.


for /d %X in (M:*) do if not exist important.txt echo %X


This statement runs, but the if portion does not run properly, always returning that the file is missing even when it exists. What am I doing wrong? Please assist. Thanks.


Aucun commentaire:

Enregistrer un commentaire