How to search files in windows file explorer with specified extension name? [closed]
Asked Answered
T

6

13

We can search files in windows 7 or higher version using the following tool: (I don't have image uploading privilage. I mean the top-right area in windows file explorer.)

When I search for MATLAB files using "*.m", it not only returns *.m files, but also returns *.mp3, *.mp4 files. Is there any way to show *.m files exclusively?

Thanks!

Towny answered 21/5, 2015 at 5:3 Comment(0)
V
20

I assume you used the quotation marks here to show the text you typed, because ironically the exact way how it should work is to put the search in quotation marks...

so

*.m

finds .mp3 as well as .m but

"*.m"

should only find the .m files. Alternatively you could also write

ext:".m"

which would guarantee that only extensions are searched. (Although I am not sure if this is ever necessary here, because while windows can have a dot in the filename and also can have files without extensions I am not sure if it is possible to have both at the same time.)

Vying answered 21/5, 2015 at 6:15 Comment(6)
In Windows 10 all of these options return *.mp3 as well as *.m for me. Having played with this for a bit I actually don't think what the OP wants is possible: the search is a little basic. The best you can do is View/Details and sort by Type, which will at least group the .m files together.Teth
I just tested this on my Windows 10 machine with Creators update and it still works the same as in Windows 7 for me.Vying
Well, IF double quotes actually worked, that would be great, but that is NOT how windows file explorer works unfortunately. Searching for, in my case: system.filename:"* 2.m??" <note there is an explicit space between the '*' and the '2'> does not produce results where the filenames end in <space>2 with an extension of m and 2 more characters. Microsoft Windows10 does such creatively useless things such as choose a file that ends in "BWV 1042.mp3" as matching that. It doesn't obey an explicit space.Noisome
@minok This is not a problem of the double quotes imo but of the combination of spaces and wildcards which are interpreted a little bit buggy. You will notice that it works with "[asterisk] [asterisk]2.m??" (but does of course not result the same things) as well as "[asterisk] 2.m[asterisk]" (which might even be good enough for you) so there is something seriously wrong with how space after the wildcard is interpreted when they are mixed. I don't think this changes anything about how this is still a valid answer to the question asked but maybe it helps you with your own search.Vying
sorry for the weird way to write that but * is reserved here for bolding so it completely broke my formatting and I couldn't figure it out in the 5 minutes one has to edit a commentVying
Ah, that could well be. Windows has always struggled with providing file transfers and search. Regex, its a good thing, but yet...Noisome
M
6

using the following

"*.m"

will solve your problem.You can find more information on regex to be used in msdn in the following link .Advanced query syntax

Marseilles answered 21/5, 2015 at 6:18 Comment(0)
P
2

Above that, you can also take advantage of the wildcard character *.

For example, if you want to search for a file with a name ending with 024 or starting with 024 then you can put in the search box like *024.* or 024*.* respectively.

Here the * after . represents files with any extensions, if you want particular then mention extension line 024.png.

Phlegmy answered 28/10, 2018 at 8:26 Comment(0)
Z
2

Explorer don't have a function of finding with RegEx. You need to use Power-Shell instead of Win Explorer;

for example: where '(?i)Out' is a regex

Get-ChildItem -Path e:\temp -Recurse -File | Where-Object { $_.Name -match '(?i)Out' }

enter image description here

Ziagos answered 23/3, 2021 at 2:54 Comment(0)
M
0

alternatively you can just simply search for your extension like this:

.extension

eg:

typing .exe will give you all the files with .exe extensions in a folder.

PS: Typing .xml OR .vmcx will give you both type of files. It is useful if you seek to make an archive of different kinds of files stored in different folders or locations.

Muff answered 22/8, 2017 at 10:33 Comment(0)
N
-1

You can get close to proper regex support from the mostly awesome Cygwin, and as a bonus you get most every linux tool running natively on linux. But it still doesnn't know that .* means "zero or more of anything", ^ means the start of a line (and $ the end), so some things are still weird.

And a startlingly large bunch of weird corner cases that only deranged perl programmers notice fail the test.

So many other things it gets wrong, but it's more workable than anything in any windows OS, plus you get perl, grep, diff, wget, curl, etc. -- the whole GNU lib for free.

If you want a full on bash shell with proper respect for regex, install the super neet-o Bash for Windows 10

Either will do what you want. And they're a billion times faster than that stupid search bar that takes off at 100 mph then crawls to 1 pixel per 10 minutes near the end.

Nabal answered 30/6, 2021 at 6:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.