Windows 7 Search - wildcards and search codes

Windows 7 Search – wildcards and search codes

This is the third in a series of posts about Windows 7 Search with some of the information that is available in Windows 7 – The Missing Manual written by David Pogue.

I’ve never been much of a sophisticated searcher either on the web or the desktop. Much of the time I just plug in the word or phrase I want to search for and let the platform do its things. I also know that for almost as long as there has been search of any kind there has been boatloads of trick that you can use to return better results, I just never seem to remember them or want to go hunting for them at the time I am searching for something.

I do know that in previous versions of Windows there were some tricks you could use while searching your files; but it seems that with Windows 7 they have stepped up the game a little with all kinds of ways to improve your search.


This option has been with us since the earliest days of DOS and Windows and consists of two wildcards: ‘?’ and ‘*’ (without the single quote marks). The simplest explanation to what the two different wildcards do boils down to this: the ‘?’ means one character appears here and the ‘*’ can stand for any number of characters – letters or numbers.

So if you are using the ‘?’ and you are searching for a file that you know part of the name of your query could look like this fo??t which would return any file that started with fr and ended with a ‘t’ but only had two unknown letters in the middle. In this case the file foxit could be one of the search results.

When using the ‘*’ as part of the search term it is best to use it either at the beginning of the word – *it – or in the middle – f*t – in either case the file named foxit would be returned as part of the results. As for using the ‘*’ wildcard at the end of the search term there isn’t much of a point because Windows search always acts like there is a wildcard at the end.

Search Codes

The one thing about the way I usually end up doing searches is that I typically end up with way more results than I really need. The way around this happening is to use search shortcuts – or codes – to further refine what you are searching for.

The simplest of these is the document types short codes. For example you are searching for a specific image but you forget its name but remember that it is a JPEG (jpg) image. In this case you can use the following short codes to refine your search

ext: .jpg
fileext: .jpg
extension: .jpg
filextension: .jpg

Another handy option as well is the ability to search by tags. Tags are typically single word descriptive terms that you can add to some files that find all the files that contain that tag. For example – tags: mom, birthday – would return all images, sound files, videos, or Word documents that have those two tags. It is important to note that not all files support tagging but they are increasing over time.

Another way to refine your search especially in regards to file contents is the use of quotes where you are looking for something that is a phrase. For example let’s say you are looking for documents that have DNA sequence in them. In order to find the documents with that exact phrase just wrap the phrase in quotes like this “DNA sequence” and only documents with that phrase will be returned, otherwise all the documents with DNA and sequence will be returned.

Finally we have what is called boolean searches and this style of searching also goes back to the very beginnings of using computers. Boolean searches boil down to the use of three different comparative keywords – AND, OR and NOT, which must be capitalized in order to work properly.  Using these boolean terms you can create some really complex search queries but that kind of in depth usage is beyond the scope of thins post (and to be honest probably my ability to explain it properly which would be a disservice to you the reader) however some simple usage might be a long these lines.

AND – using this boolean between your search terms will tell Windows Search to return all files that contain those words e.g.: mom AND birthday will return all the files that have both mom and birthday in them. You can also further refine the search by placing multiple terms in parentheses like this – (mom AND birthday) AND (dad AND stupid). In this case only files that included mom and birthday but also included dad and stupid would be returned.

OR – using this boolean will return all the files that have either of the two words in them e.g.: mom OR birthday will return files that contain the word mom or the word birthday in them. As with the AND boolean keyword you can create even more refined search by using combinations of the boolean keywords so you could have something like this (mom AND birthday) OR (dad OR stupid). This would return documents that contain both mom and birthday as well as files that contain dad or stupid.

NOT – this is a great boolean keyword to have available as it lets you tell your search to not return results that contain specified terms e.g.: mom NOT birthday will return all the files containing the word mom in it but will eliminate any results that contain the word birthday in it

Last but not least

As handy as these little tips might be they only scratch the surface of the different ways you can improve your search results as there are still some more search criterion that you have access to in Windows. The following is a sampling of the most commons that you might find useful.

name: if you are only looking for a file rather than including searching its contents you can use this criterion to restrict the search to just filenames – name: mom

created: you can find files that were created on a specific date – created: 7/25/10 will return only those files created on July 25, 2010

received: let’s say you were looking for a specific email but you can only remember that you received it at some point last week or earlier. By using two periods ‘..’ between two dates your search will return only the emails you received between those dates – received: 3/1/2010..3/15/2010

size: by using something like size: 2gb only the files of that size will be listed in your results. Also as with the received: example you can use the two periods to return the files between a size range – size: 2GB..10GB

<> qualifiers: let’s say you wanted to find all the files less than a certain size. In this case you could use a search term criterion like this size: <2GB which would return all the file smaller than 2 GB

rating: a quick and dirty way to list all the songs that you have given a rating to would be something like this rating: >**** which would return all the songs (or videos) with a rating of four or five.

The range of criterion that are available to you to use in searches is over 100 and covers everything from file size to camera flash rate. If you want to know the full range of criterion available first right click on the column heading in Explorer and then on the More… menu item in the right click context menu

Then from the Choose Details dialog you will be able to see all the criterion available for searches. Now not all of them will be usable as criterion but at last count 115 were usable so there will be some trial and error involved in finding out which ones will work for now. If I come across a complete criterion list I’ll update this information.

Hopefully now you’ll know a little bit more about how to do some fancy search ninja moves and if not I still have a few more posts to come about Windows 7 Search that might get you there.