Tuesday, September 4, 2012

File Search in Windows 7

Something that I have felt Microsoft have made much more difficult in the newer versions of Windows is to find specific files. The primary reason for this is now the only search facility is a single search box. On previous versions of Windows pressing Ctrl+F would bring up a search dialog that would present the user with various options for the files they wanted to find.

Recently I needed to find some files on my system, however I wanted better control of the results and I didn’t want to search for a specific file name. In frustration I read the Windows Help topic and this identified that it is actually possible to use special notation inside the search box to control what is being searched for. The online help is not complete (no surprise there!), but it does give some indication as to what is possible.

Basic Search

Just enter the filename or partial filename that is being searched for. Wildcards “*” can also be used.

Find a specific document:

thisisthedocument.doc

Find all documents (.doc, .docx)

*.doc*

File Attribute Search

Results can be filtered based on the file attributes. For example the last modified time of a file:

lastmodifiedtime: 22/02/2012

This fine files with the specific date, however if you want to find files newer than this date you can add the > symbol.

lastmodifiedtime: >22/02/2012

Find in files

The ability to find in files was one of the most useful features within Windows XP, and the ability appeared to have been removed in later versions of Windows. Doing a Google search for the ability to find in files, there are a number of utilities that can be installed that will allow this. One recommended utility is AstroGrep as this provides a nice clean interface and is quick to perform the search.

However following my discoveries around the file attributes search I was beginning to believe that it may be possible to do this within the Windows file search. And it turns out that it is, using the content keyword.

content: “find this is a file”

Only including certain types

In my example looking for files newer than a certain date, it was also including a lot of folders. These can be excluded using the kind keyword.

kind: <>folder

Summary

So it turns out the windows file search is actually a lot more useful than I had thought; sometimes reading the manual or online help does actually pay off!