Find all files that are NOT of a specific type/extension in folder?

41

11

Windows 7 Ultimate 64bit:

I'm looking for a way to find all the files in a directory that are NOT of a specific file type or extension.

Example: I'd like to find every file that isn't an .mp3 in my music folder (and all sub folders).

Jeff

Posted 2011-08-26T06:40:41.693

Reputation: 565

Related: How can I see the available Windows Search Filters?

– Scott – 2015-12-30T08:36:04.440

1Related, sure, but not duplicate. This is asking about the syntax for the built-in search, not specifically about a third-party utility. – Synetech – 2011-08-27T01:57:49.487

Answers

60

type this in the search box of the directory you want to search

NOT *.mp3

Terry

Posted 2011-08-26T06:40:41.693

Reputation: 1 379

How to make this work in windows XP? – Pacerier – 2014-08-27T13:14:34.463

4This was new to me, but brilliant! After testing it, I want to add you can do multiples, such as NOT *.mp3, NOT *.aiff, etc. You can even do "NOT folder" to exclude folders. – Jeff – 2015-07-17T20:01:18.993

But how to add several NOT conditions to a file type:folder search? Question here: http://superuser.com/questions/1001163/windows-7-search-multiple-condition-find-folders-of-this-size-that-does-not-co

– JinSnow – 2015-11-16T07:30:58.763

2Old thread, but there was a question to be answered. @Guillaume You can chain AND NOT after your initial arguments. – avluis – 2017-02-27T08:32:28.353

7

From a command prompt you can pipe the direcotry list into findstr, and use findstr's V switch to exclude lines like the filter (in this case, lines ending in .mp3), as well as the I switch to make the find procedure case-insensitive.

dir | findstr /vi "*.mp3"

Ƭᴇcʜιᴇ007

Posted 2011-08-26T06:40:41.693

Reputation: 103 763

2

I just open the folder with Windows Explorer, add the Type column to the display, and sort on it.

Daniel R Hicks

Posted 2011-08-26T06:40:41.693

Reputation: 5 783

0

Step 1: Get FindUtils.
Step 2: find some\dir -type f ! -name *.mp3

Ignacio Vazquez-Abrams

Posted 2011-08-26T06:40:41.693

Reputation: 100 516

0

You could try

xcopy /L /EXCLUDE:.mp3 /S DIRNAME .

The /L flag forces xcopy to only list but not copy the /s runs through all subfolders and the exclude misses out mp3s

Col

Posted 2011-08-26T06:40:41.693

Reputation: 6 995

0

For a quick look I sort by clicking on the type column header in Explorer. There is a pull down option to tick boxes for only the files you want listed.

BrianA

Posted 2011-08-26T06:40:41.693

Reputation: 1 514

0

You can check a mime-type with:

file -i <YourFile> -F "::" | sed 's/.*:: //' | sed 's/;.*//'

and then write a script.

Adobe

Posted 2011-08-26T06:40:41.693

Reputation: 1 883