Helping people with computers... one answer at a time.
Windows includes a utility that will search through a collection of files for a specified string. That's often a quick way to find the file you want.
Recently, I needed to recover an email that had been permanently deleted from Windows Mail and managed to do so from a C:\ drive backup. However, because of the obscure nature of the email file names (e.g. 61712BF9-00000413.eml), I had to open them, one by one, until I found the wanted one. Is there a quicker way and can these file names be decoded then to make them more understandable?
•
Yes, there is a quicker way.
No, there's no way that I know of to make those filenames more meaningful.
What we need is a quick way to scan inside of those files. Fortunately, Windows has a way.
•
One of the improvements that Windows Mail made over the older Outlook Express is that emails are stored in individual files on your hard disk. That makes what we're about to do much easier.
I need to introduce you to a command-line tool.
Findstr, for find string, is a tool that searches files for strings or sequences of characters. (Linux & Mac folks will recognize it as similar to the program "grep").
For example, you can use Findstr to show you all the files in a folder that contain the word "lenticular".
Or files that have lines that begin with the word "Subject".
Let's see how that's done.
The general syntax for Findstr is "Findstr string files" where:
string - is the string you're searching for
files - are the files to be searched
Fire up a Windows Command prompt, and "CD" to the folder that contains the files you wish to search. In this example I'll assume all the ".eml" files are in the folder "C:\t".
I've added the "/B" option (the "Begins with" option), and Findstr is showing me the filename and the matching line from all the ".eml" files that begin with the word "Subject". Since these are all email files in text format, it's showing me the filename and the Subject of the email contained within it.
That alone may be enough for you to identify the email you're looking for. If not, try removing the "/B" looking for other things that might occur anywhere: a unique word you know is in the body, an email address that might help narrow it down, and so on. If you have hundreds of email files, as many of us might, using this to quickly narrow it down to a smaller set to investigate further save a lot of time.
Sometimes it'll be all you need.
Findstr is an extremely handy utility, but it has one limitation: it's intended to work on plain text files; files that contain primarily only letters, numbers and a fairly limited number of symbols arranged as readable text.
You can use Findstr on other files, if you like, but the results will be ... unpredictable.
Microsoft Word documents are most certainly not text files, but it might be enough for you to know that of the 100 Word documents in a folder only these two contain the word "frenetic". (You may want to turn off your speaker, however, since one character, when displayed, actually causes a beep. Better to use the "/M" option which prevents the matching line from being displayed and only prints the filename within which it was found.)
Even some text files may be somewhat confusing. For example, web pages are in fact text files, but they contain a lot of extra information that you normally don't see when they're displayed in a browser. Regardless, once again just knowing that this file contains that string can be very helpful.

image by Tall
Chris on Flickr.
Findstr has many, many options to help you search files for strings. I was going to list them all here, but there are too many. Instead:
Will list all the options and give you some basic information on some of the syntax you can use for advanced searching.
One important option that I will mention is the "/I" option to search without regard to case.
In case-sensitive search the words "Subject" and "subject" are not the same - the case of the first letter is different. In a case-insensitive search, they're they same as upper/lower case is not taken into account.
Article C4559 - November 12, 2010
What's wrong with using the Search facility in Windows Explorer? If you select "All files and folders" there's a place to type in a word or phrase to search for.
Or am i missing something about the question?
17-Nov-2010
Posted by: Nick at November 16, 2010 4:14 PM
a program like Copernic will show you the content of files as well as just the file name. I work with people who simply will not name their files clearly, or even keep track of where they put them; Copernic is a god-send to finding "lost" data. It works in the background and will index the entire drive. Free version serves up ads, but still so much better than Google desktop.
Posted by: phil lethes at November 16, 2010 9:33 PMLeo, you can search the file name and a word or phrase in the file. I use it all the time. Click Search button, then on panel on left select "All files and folders" (3rd item down), then you get three input boxes: "All or part of the file name", "A word or phrase in the file", and "Look in". Type what you are looking for in the middle pane and put the root folder in the bottom one. You can use the top one to restrict the file names. The search then lists all the qualifying files that contain the said phrase or word.
Posted by: Nick at November 17, 2010 10:38 AMWindows Search Deskbar, which routinely indexes files daily, and as well, provides detailed instructions, to search for, or 'within' specific files appears to be a very effective method to locate lost or otherwise required files or their contents. Thanks.
Posted by: John L Brown at November 26, 2010 2:36 AMThe only "search" I can find in Win7 is the awful indexing version. I used to use the proper search in XP all the time. Is there a proper search available in Win7?
Posted by: Graham Vine at December 1, 2010 6:08 AM