Getting The Most From Windows Search (Part 2)

Source: Windows Secrets

By Woody Leonhard

In my Sept. 22 Woody's Windows column, I stepped you through the basics of searching in Windows 7 — in particular, Win7's two undocumented search idiosyncrasies that can cause no end of confusion.

In Part 2, I give you the advanced course, including how to search in Win7 the way you used to in Windows XP, Windows 95, or (gulp!) even DOS.

Search for filenames, the new old-fashioned way

Here's how most experienced Windows users get turned off by Windows 7's search: they click the Win7 Start orb, type something into the Search box, and wait while Windows comes back with results — first in bushels, then in barrels, and finally an avalanche.

"Whooooa!" (or something slightly less printable) they say, "I only wanted to find files with this text in the filename …. Windows 7 is useless; they've even included spam messages in here." Yes, I still hear from old-timers who cluck-cluck-cluck that even DOS did it better.

Typing text into the Windows 7 search box is a bit like sticking a straw into an open fire hydrant. As I recommended in Part 1, if you have any idea where the text you seek may be located, you're far better off going to that location (with Windows Explorer, say, or Outlook, or Live Mail) and starting the search from that folder or one above it. Yes, Windows indexes spam messages — which is to say, mail in your Junk Mail folder — and it'll bring up the junk if you give it enough time. Nothing you can do about it.

What if you're just looking for a filename? Not so long ago, that's all you could look for. Though the rules and syntax are a bit strange, it's possible — even relatively easy — in Windows 7.

Let's say you want to find file names that contain the text string "secret." You use the symbols ~= like this:
system.filename:~="secret"
That will match files with names such as Windows Secrets.doc and MySecret.html.

To look for files with names that begin with a specific piece of text, use the ~< symbols. For example:
system.filename:~<"secret"
That will match Secrets.com but not SomeSecret.xls.

If you need an exact match, use the = sign this way:
system.filename:="windowssecrets.txt"
That returns only files named WindowsSecrets.txt or windowssecrets.txt.
(In all three examples above, the searches are case-insensitive.)

You can use the colon without a qualifier, but you get the weird rules for matching filenames that I described in my last column. In other words, Windows matches text at the beginning of a file name, after a space, or after the period — and that's it. So,
system.filename:"sec"
matches Secrets.ppt, My Secretary.jpg, and win.sec — but it doesn't match, for example, MySecrets.gif.

It's important to realize that the system.filename: trick works all over the place — inside Windows Explorer, of course, but also in the File/Open dialog boxes in various Windows and Office applications. I have a yellow sticky note on my monitor that says system.filename:~="{search string}".

Using wildcards in ways that make sense

If you've used DOS, or the Windows command line, or written a .bat file, or gone searching for text using Word or Excel, you're probably very familiar with wildcards:

characters that serve as generic placeholders. For example, in DOS, searching for a string such as Invoice*.xls will turn up all the .xls files that start out with Invoice. On the Windows command line or in .bat files, searching for win32.* gives you all the files named win32 with any filename extension. The asterisk (*) is a wildcard, and in the Land of DOS it matches anything.

If you think you can use that time-honored technique in Windows 7 Search, think again — it doesn't work that way. When you type an asterisk into a Windows 7 search box, Windows takes the characters following the asterisk and uses them to match any part of a file name. It's another idiosyncrasy that leads some old-timers to drink — or at least, to cluck.

Say you're in Windows Explorer or you click File/Open in Word, and you then type *doc into the Search box. Here's what happens:

As soon as Win7 sees the *, it doesn't bother looking inside files. You could have the text *doc inside a Word document, and Windows won't find it.

Instead, Windows starts scanning filenames, matching any names containing the characters doc. So as you'd expect, you'll receive hits for every file with a .doc extension
(such as WindowsSecrets.doc) — plus you'll get the odd file with the text "doc" inside the name (such as DryDock.jpg). Again, you won't get any hits based on what's inside the file.

Making Windows 7 index where you search

In my previous column, I talked about why it's important to have Windows 7 index the locations you commonly use. For file searching, it's a speed thing. By default, Windows 7 indexes files in all user libraries. (See Fred Langa's March 10 Top Story for details about Win7 Libraries.) If you have a PDF viewer, such as Adobe Reader or Foxit, the PDF files inside those libraries get indexed. If you use Outlook or Windows Live Mail, your mail gets indexed, too. (Win 7 might index mail in other e-mail clients.) So, what if you frequently search for files in folders that aren't indexed by default? Unless you can add those folders to your libraries (a good idea, in general), you need to tell Windows where to build its indices. Note, however, you can add a folder to your PC's index only if it's located on the PC — you can't add a networked folder or the contents of an external USB drive.

Here's how to add a folder to your index:

Pick a time when you're not going to need the PC for a few hours (such as overnight). You run indexing just once, but it can take what seems like eons to complete. Click Start, type index into the search box, and press Enter. You'll see the Indexing Options dialog. Click Modify. An Indexed Locations dialog box will appear, like the one shown in Figure 1.

Figure 1. You can tell Windows exactly which folders you want to include in your search index. In the upper panel, navigate to subfolders by clicking the small arrows next to the drive or application (highlighted in yellow in Figure 1). Check the boxes next to the folders you want to add. When you're done, click OK. Reindexing might take a while, but when Windows is done, searching all those new locations will go faster than ever.

Refining searches with advanced operators

I've never been one to use the so-called advanced features in Windows 7 Search — I usually go back and reformulate a search rather than try to fiddle with Boolean operators or restrict dates or file sizes. The only enhanced search commands I commonly use are system.filename and the * wildcard discussed above.

If you like spelunking, though, feel free to try the advanced options nicely described in Microsoft's Help & How-to article, "Advanced tips for searching in Windows." You can search in other locations, search on the Internet (sorry, Bing, I still prefer Google), or use the Boolean operators AND, OR, and NOT. (Just keep in mind that Microsoft requires you to capitalize them.)

Although many of you have written with recommendations for competing products — for example, FileSearchEX and Copernic Desktop Search (see the related forum on the Lounge) — I'm reasonably happy with the way Win7 Search works, and I really appreciate that it doesn't get in my way. Hopefully you now have some good clues about why your searches don't turn out as expected — and you have a couple of mostly undocumented tips on how to make Windows 7 searches work better.
http://windowssecrets.com/newsletter/getting-the-most-from-windows-search-part-2/

Return To The How To Do It Page


Updated on ... February 23, 2015