11/07/2015

Windows Explorer Search – Learn something new every day…

 

I was searching through around 400 folders with thousands of files for all of the files that contained "_files" in their names. Should be easy… open Windows Explorer and type in the search box *_files* and wait… but I got back every file as if I had typed "*".

Is the underline a wildcard?

Not according to the documentation I can find, and it does not otherwise behave like a wildcard. For example, searching for "f_le" or "*f_le*" did not find anything.

Is the underline ignored?

Seems like it. Except… if you include a file type in the search then the underline is treated as an ordinary character or if you use the FileName property.

Two solutions:

Add a filetype wild card:   *_file*.*   

Search using a property name:   filename:*_file*    (but don't add ".*" if you are also looking for folders!)

 

What about good ole DOS?

Works exactly as expected.   DIR *_files* /s   .

 

What about PowerShell

Also works exactly as expected.   dir -Filter *_files* –Recurse

I should have started with PowerShell anyway as the next step was to rename these files! Smile

 

What creates file names that include "_file"?

Internet Explorer when you use File, Save As, Web Page Complete.

 

.

No comments:

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.