3 Ways to Search Content of Files Windows 10

You may have saved a lot of files on your Windows 10/11 PC. Normally, you can search files by name to locate a specific file. What if you can’t remember its file name? In that case, you can search the content of files in Windows 10. Here are 3 ways to do it.

You can search through the file content from the Start Menu Search or File Explorer. This feature is disabled by default. You can easily enable it for convenience. If you prefer the command line, you can also search text in files from the command line. Sounds interesting? Keep reading to learn how.

Windows Search Content

As mentioned, it is possible to search file content in Windows 10 from Start Menu Search or File Explorer. If you are unable to do so, then it is because that feature is turned off by default. So, in order to use this feature, you need to enable this feature.

To enable searching content of files in Windows 10:

Step 1. Type “Indexing options” in the Windows Search Bar and select Indexing Options from the results.

Step 2. From the Indexing Options window, click Advanced at the bottom.

Step 3. Under Advanced Options, click on the File types tab. You can see all the extensions are selected by default. If the file extension that you want to search the content of is not listed here, you can add a new extension to the list at the bottom.

Step 4. Check the option Indexed Properties and File contents option and click OK to confirm.

After your confirmation, Windows will start to rebuild indexing. Once complete, you can now find text in file on Windows 10.

Step 5. Press Windows + E to open File Explorer.

Step 6. Navigate to the directory where you want to start the search. If you have no idea, just click This PC, which will take longer.

Step 7. You will see a search box in the right top corner. Type the text in the search box you want to search the content of the available files. Wait for the results to appear.

The results will include both the content of files and the file name that contains the text that you searched. Additionally, you can use Windows File Explorer search syntax for more convenience.

Most users, if not all, will think the File Explorer search is slow even with index properties only. Now, you are trying to search index properties and file contents, it is going to be even slower. If you want Windows to search inside files faster, keep reading to find better alternatives.

String Search text in files Windows 10 command line

Findstr is a built-in feature in Windows 10 command line search for files. You can search individual files or the entire directory with your search query. To learn all the parameters, you can simply run the “findstr /?” command from an elevated command prompt.

You can refer to the steps below to use Windows 10 command line file search.

Step 1. Open an elevated command prompt. You can type “CMD” in the Windows search bar and press Enter. In the listed results, right-click on Command Prompt and select “Run as an Administrator”.

Step 2. Refer to the syntax to type your command to start the search.

Syntax:

FINDSTR string(s) [pathname(s)]
[/R] [/C:”string”] [/G:StringsFile] [/F:file] [/D:DirList]
[/A:color] [/OFF[LINE]] [options]

Some examples:

Searches the document windows.txt under D:/Documents/ folder for the string “Windows 10”

findstr /c:/documents/ “windows 10” windows.txt

Searches any file under d:\documents for the string “windows”.

findstr “windows” d:\documents\*.*

Search for the occurrence of all words ending with ‘xyz’ in every txt file under D:/Documents/ including all subdirectories.

findstr /R /S [a-z]*xyz d:\documents\*.txt

Useful parameters:

  • /? — display the help text
  • /S — searches the directory and all subdirectories
  • /I — search is not case sensitive
  • /R — use search strings as regular expressions
  • /B — matches patterns at the beginning of lines
  • /P — skip files with non-printable characters

Findstr is quite powerful in terms of searching the content of files because you can search and filter results with the above parameters. You can also use regular expressions and wildcards to match all kinds of situations.

If you don’t know anything about regular expressions and wildcards, I would suggest you try a third-party program Anytxt. It comes with a concise interface and multiple features.

AnyTXT

Anytxt Searcher is a free, powerful local document and text search tool for Windows that is much faster than the built-in Windows Search. It works like the local disk version of the Google search engine. It’s the best full-text search engine for desktop files.

With a powerful document parsing engine, Anytxt Searcher can extract any text of common documents without the need for additional software. By harnessing the built-in high-speed indexing system, Anytxt makes it easy to locate any files based on the file content, filename, file type, etc.

Time is precocious. You don’t want to waste it on searching local files, so you should try Anytxt to see how fast it can get your files according to your request. It is completely free without limitations. You can refer to the steps below to see how it works.

Step 1. Free download, and install Anytxt. Click to free download Anytxt. It is available for Windows 7/10/11.

Step 2. Open Anytxt Searcher, and enter any term in the search box on the left.

Step 3. Click the “+” icon on the top left to filter search directories and file types if needed. Wildcards are supported here.

Step 4. Click the “Go” button on the left, or press Enter to start searching the content of files. Instantly, all the match files will be listed here.

Hover your mouse on any result for 1 second and it will show you the matched text. Anytxt also offers translation features. In addition, you can also quickly start an Anytext search in File Explorer. You can right on any directory and select “Anytxt Search” to search any content in that directory.

If you need an OCR image search, you can download the Anytxt Searcher OCR installer to search text in images on Windows.

Conclusion

These 3 ways to search the content of files in Windows have been tested working in 2024. File Explorer search is the most convenient way, but the slowest. Findster is much faster than File Explorer search but the learning curve can stop many users. All in all, Anytxt is best for search the content of files in terms of speed and ease of use.

How to Search a File by Content in Windows 11 ?