`DIR /B /O:N > filename.txt` but only showing folders without a certain file

0

I'm trying to make a list in XP of folders which do not contain a .jpg file.

I use DIR /B /O:N > filename.txt for making a folder list. It works perfectly, but now I need a list where the folders without a certain file type is listed.

Is it possible?

rai come

Posted 2014-09-02T07:42:33.907

Reputation: 1

This does not explain how to show folders not contaning a specific file – rai come – 2014-09-02T08:44:17.650

Answers

0

(for /d %a in (*) do @if not exist "%~fa\*.jpg" echo %~nxa) > folderList.txt

For each folder, if not exist a jpg file inside it, echo the name of the folder.

To use it inside a batch file, remember to escape the percent signs, that is, replace % with %%

MC ND

Posted 2014-09-02T07:42:33.907

Reputation: 1 286