Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
Related:… – Lance Roberts Aug 26 '11 at 16:20
Related, sure, but not duplicate. This is asking about the syntax for the built-in search, not specifically about a third-party utility. – Synetech Aug 27 '11 at 1:57
up vote 22 down vote accepted

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

NOT *.mp3
share|improve this answer
As simple as it is effective, thanks djerry! – Jeff Aug 30 '11 at 3:33
How to make this work in windows XP? – Pacerier Aug 27 '14 at 13:14
This 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 Jul 17 '15 at 20:01
But how to add several NOT conditions to a file type:folder search? Question here:… – Guillaume Combot Nov 16 '15 at 7:30

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"
share|improve this answer

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

share|improve this answer

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

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

You can check a mime-type with:

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

and then write a script.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.