How to search file contents in Windows (5 methods that actually work)
Last updated: · written by the FileLocator team
The short version: File Explorer can search inside files — type
content:yourwordin the search box — but it only looks inside files that Windows Search has indexed, which by default excludes most of your drive. Fix the index via Indexing Options → Advanced → File Types and Enhanced mode, or skip the index entirely: Agent Ransack (free) searches the text of any folder on demand, grepWin handles code and plain text with regex, DocFetcher pays off when you search the same document library repeatedly, and PowerShell'sSelect-Stringcovers quick one-off jobs.
Method 1: File Explorer's content: prefix
Windows has had content search built in since Windows 7 — most people just never see it because the default search box mixes filename and content results without telling you which is which.
- Open the folder you want to search in File Explorer.
- Click the search box in the top-right corner.
- Type
content:invoiceto find files containing the word "invoice", orcontent:"net 30 days"with quotes for an exact phrase. - To narrow by type, combine filters:
content:invoice ext:.docxfinds only Word documents containing the word.
Here's the catch, and it's a big one: File Explorer only searches inside files that the Windows Search index has already read. Outside indexed locations — most of your C: drive, every external drive, every network share — Explorer either falls back to a painfully slow on-the-fly scan or silently returns nothing. By default, Windows indexes only your user folders (Documents, Pictures, Desktop) and the Start menu. If your files live in D:\Projects or C:\Work, the content: prefix will miss them completely, with no warning.
Method 2: Fix the Windows Search index
If you want Explorer's content search to work properly, you need two settings changed. Both are buried.
Tell Windows to index file contents, not just names
- Press Start, type Indexing Options, and open it.
- Click Modify to add the folders you actually work in (e.g.
D:\Projects) to the indexed locations. - Click Advanced (needs admin rights), then open the File Types tab.
- Select an extension —
.txt,.docx,.csv, whatever you search — and at the bottom choose "Index Properties and File Contents" instead of "Index Properties Only". - Click OK. Windows will offer to rebuild the index; accept, and expect it to take from twenty minutes to several hours depending on how much you indexed.
Turn on Enhanced search mode
- Open Settings → Privacy & security → Searching Windows.
- Under Find my files, switch from Classic to Enhanced. This indexes your whole PC instead of just libraries and the desktop.
Even fully configured, the index has blind spots: network drives are never indexed from the client side, newly created files can take minutes to show up, and some file types have no content filter installed (scanned PDFs are the classic case — see our guide to searching inside PDFs). If searches feel sluggish or results go stale, our fix for slow Windows search walks through rebuilding the index and the service-level repairs.
Method 3: Agent Ransack — content search without an index
For searches the index can't cover, Agent Ransack is the free tool we reach for first. It reads files directly off the disk at search time, so it finds text in any folder, on any drive, with zero setup — at the cost of a slower search than an indexed lookup (in our testing, scanning a 40 GB project folder for a phrase took a couple of minutes rather than the instant results an index gives you).
- Download Agent Ransack free from mythicsoft.com and install it.
- In Look in, pick the folder or drive to search — anything works, including USB drives and mapped network shares.
- Leave File name blank (or use it to restrict types, e.g.
*.docx;*.xlsx). - Type your search in the Containing text field.
- For complex queries, click the Containing text drop-down options and enable Boolean expression — then you can search
invoice AND (overdue OR unpaid)— or switch to Regular expression mode for patterns. - Press Start. Click any result and the lower preview pane shows every matched line in context, so you can confirm the hit without opening the file.
Agent Ransack ships with filters for Office formats and text-based PDFs, so it reads inside .docx and .xlsx files, not just plain text. Its paid sibling, FileLocator Pro, adds more formats and faster multi-threaded scanning.
Method 4: grepWin for code, DocFetcher for a library you search often
grepWin — plain text and source code
If what you search is code, logs, config files or anything plain-text, grepWin is faster to invoke than anything else here:
- Install grepWin, then right-click any folder in Explorer → Search with grepWin.
- Enter your search as plain text or a regex (e.g.
TODO|FIXME). - Optionally fill the Replace with field — grepWin does regex search and replace across thousands of files, with capture groups and a backup option.
The trade-off: grepWin treats files as raw text, so it won't see inside .docx, .xlsx or PDF containers. Wrong tool for Office documents; perfect tool for a codebase.
DocFetcher — when you search the same folders repeatedly
If you query the same document library every week, scanning it from scratch each time is wasted minutes. DocFetcher is an open-source desktop search engine that builds its own content index once, then answers queries in under a second:
- Install DocFetcher (it needs Java; a portable build is available).
- In the Search Scope pane, right-click → Create Index From → Folder, and pick your library. Initial indexing of a few gigabytes of documents typically takes several minutes.
- Search with
AND,OR, wildcards and phrase queries; results show highlighted excerpts.
Index once, search forever — but remember to let it re-index when the folder changes.
Method 5: PowerShell's Select-String one-liner
No installs, works on any Windows 10/11 machine. Open PowerShell in the folder (Shift + right-click → Open PowerShell window here, or type powershell in Explorer's address bar) and run:
Get-ChildItem -Recurse -Include *.txt,*.log,*.csv |
Select-String -Pattern "timeout" |
Select-Object Path, LineNumber, Line
That lists every file, line number and matching line under the current folder. Add -SimpleMatch to treat the pattern as literal text instead of a regex, or -CaseSensitive when case matters. Like grepWin, this reads raw text only — Office files and PDFs are opaque to it.
Which tool should you use?
- Occasional searches in your Documents folder — File Explorer's
content:is fine once the index is configured. - One-off deep search of any folder or drive — Agent Ransack, free and thorough.
- Code, logs, configs (and search-and-replace) — grepWin.
- The same document library, searched weekly — DocFetcher.
- Quick ad-hoc check, no installs allowed — PowerShell
Select-String.
All four third-party options above cost nothing — they all appear in our roundup of the best free file search tools, and our Windows file search hub maps the whole ecosystem, including filename-only speed demons like Everything.
Troubleshooting
Content search finds nothing in PDFs. Two possible causes. If the PDF is text-based, Windows needs a PDF iFilter registered (modern Windows 10/11 includes one, but the extension must be set to "Index Properties and File Contents" in Indexing Options → Advanced → File Types). If the PDF is a scanned image, there is no text layer to search at all — you need OCR first. Our search inside PDFs guide covers both fixes.
Network shares return no content results. Windows never indexes network locations from your PC, so content: on a mapped drive triggers a slow unindexed crawl or fails silently. Use Agent Ransack pointed at the UNC path instead, or index on the server side — see searching network drives.
New files don't appear in results. The indexer runs in the background and backs off while you work. Wait a few minutes, or check progress in Indexing Options ("Indexing complete" vs. items remaining). If it never catches up, rebuild the index.
Explorer search is unbearably slow. You're probably searching an unindexed location, which forces a file-by-file scan. Either add the folder in Indexing Options → Modify, or use a tool that's built for unindexed scans like Agent Ransack.
FAQ
Can Windows 11 search inside files without extra software?
Yes — type content:yourword in File Explorer's search box. But it only works in indexed locations with the file type set to "Index Properties and File Contents", which is why it feels broken out of the box. Configure the index (Method 2 above) or use a free tool like Agent Ransack for everything else.
Why does content search find some Word files but not others?
Almost always location: the files it finds sit in an indexed folder, the rest don't. Check Indexing Options → Modify to see exactly which folders are covered, and add the missing ones. The second suspect is the extension's setting under Advanced → File Types.
What's the fastest way to search file contents across a whole drive?
For repeated searches, an indexed tool — DocFetcher, or Windows Search with Enhanced mode on. For a one-off, Agent Ransack scanning the drive directly is simpler than waiting hours for an index to build, even though the single search takes minutes. Indexes win on repeat searches; on-demand scanners win on the first one.
Want the full rankings?
We tested every major content-search tool against a 1.2-million-file library — here's what won.
keep exploring
Related reading
How to search inside PDFs
Text-based vs. scanned PDFs, iFilters, and OCR — make every PDF on your drive searchable.
Fix slow Windows search
Rebuild the index, repair the search service, and know when to replace Windows Search entirely.
The complete Windows file search guide
Explorer search syntax, indexing options, and the full third-party tool ecosystem in one hub.