If you’re like most people, you probably use Windows search to find text inside of any file. This is a great way to find specific words or phrases inside of a file, and it’s also a great way to find files that are similar to those you’re looking for. To search for text inside of a file using Windows search, open the File menu and select Search. In the search box, type in the text you want to find, and then click on the Find button. The Find dialog box will appear, and you’ll be able to choose which files to search in. If you want to search all files in a directory, or if you only want to look for text within certain files, you can use the -all flag with the Search command. This will tell Windows not only to search for text within each file in the directory, but also any subdirectories. If you want to use Windows search with an external application such as Google Earth or Microsoft Excel, you’ll need to create an instance of that application and then add the -search parameter when running Windows search.
Many of us rely on Windows Search to find files and launch programs, but searching for text within files is limited to specific file types by default. Here’s how you can expand your search to include other text-based files.
We have shown you some advanced search operators using Windows Search before and even how to change which files are indexed and how to rebuild your search index. But what about searching for text inside of .html, .php, .js, and other text-based web and scripting files? Windows search allows you to include other file extensions in its index with a few simple clicks.
RELATED: Learn How to Use Windows 7’s Advanced Search Operators
This technique works in Windows 10, 8, 7, or even Vista. The screens might look a little different, but it’s the same basic process on all versions.
Hit Start, type “index,” and then click the “Indexing Options” result.
In the “Indexing Options” window, click the “Advanced” button.
In the “Advanced Options” window, switch to the “File Types” tab. Select the extension for the file type you would like to include in content searches, and then select the “Index Properties and File Contents” option under the list. The text in the “Filter Description” column should change to reflect whatever filter is used to open that file type by default. In our example, we’re selecting the BAT extension, so the filter type changes to “Plain Text Filter.”
If you don’t find file type you’re looking for on the list, it means no app is set as the default handler for that file type. To add the file type, type the extension in the “Add New Extension to List” box and then click the “Add” button. By default, Windows Search will use a plain text filter to search the contents of those types of files, since another app is not associated.
After the index is rebuilt, searching for text inside one of the new file types should now show results.
If you’d like to always search within file contents for a specific folder, navigate to that folder in File Explorer and open the “Folder and Search Options.”
On the “Search” tab, select the “Always search file names and contents” option.
After the index rebuilds, searches in that folder will automatically include file contents.