4

In Win 7, how can I search for a word in the contents of all files in a specific folder.

In XP this was easy. All you had to do was type the word into the "A word or phrase in file" text box on the search window and it would only include files containing that word in the search results.

4 Answers 4

2

Findstr may fit if you are familiar with Windows command line, findstr is some kind of grep for Windows, and it comes with Windows starting version XP. Personally Im using bash for windows, and grep inside of that, but this is third party software, and do not comes with Windows by default. Example of findstr: enter image description here

\s searches for matching files in the current directory and all subdirectories

2>nul is to get rid of errors for files that you cannot open

1
  • Thanks for the graphic detail.
    – dakab
    Mar 11, 2021 at 15:28
1

In the upper-right of Explorer, there's a search box.

Complete that, and press search. After that search completes, there'll be a "Search again in:" at the bottom of the screen. Here you can specify for it to search the File Contents

1
  • 1
    So no way to do it from the outset?
    – CJ7
    Nov 2, 2012 at 0:36
0

If you want something a bit more like Windows XP search have a look at a free tool called Agent Ransack.

Some other tools are mentioned here:

Best way to *confidently* search files and contents in Windows without using an indexing service?

0

At first the windows explorer will search for all files that have "test" as part of the file name, but if you scroll to the bottom of the search results you can see the following:

Initial search results

Limited Solution

Click on File Contents and it will perform a search within the files for the keyword "my key word".

Nevertheless, I cannot tell why this option is not available in all folders like on the Desktop. Even for this context windows implemented a solution: Start your query with content: and join the keyword. Quotation marks are required if you are searching for more than one word.

As general as these solutions are supposed work, they failed in my practice test, where it should to find a keyword from a python file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .