Share via

Windows File Explorer search not finding text in files that is obviously there

Anonymous
2023-05-15T22:10:27+00:00

After looking at the numerous inquiries about how to make this work and being unsuccessful, and not wanting to waste a lot of time trying to make it work, I resorted to using the following MS-DOS command:

FOR /F %i IN ('FINDSTR /M "string-to-be-searched" *.txt *.tmp') DO Notepad.exe "%i"

This command will open each file containing the search argument with Notepad. Of course, it will only work if the target files contain plain text.

Change "string-to-be-searched" to your desired search argument. You can use regular expressions by specifying the /R switch on the FINDSTR command. (See Microsoft docs for syntax.)

Replace *.txt and *.tmp with whatever type of files you want to search. Run the command after changing the current directory to the folder to be searched. Obviously, you can change the action to do something else rather than open Notepad.

I know this is ancient, but it works, which is more than I can say about Windows Explorer search. (Windows Explorer will pretend to search the folder and come up empty; and yes, I changed the Search Advanced Options to search file contents in "non-indexed locations":

You would think that if something is misconfigured such that it can't perform a real search, it would report that and not just pretend to do it.)

There is probably a PowerShell command that can do this more elegantly, but I didn't want to get that deep into it.

For what it is worth...

Windows for home | Windows 10 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2023-05-15T23:49:19+00:00

    Hi, BitEngineer. I'm sorry to hear you're having this problem, and I hope I can assist you to find a satisfactory solution.

    I can provide some additional suggestions to troubleshoot the issue:

    Rebuild the search index: The search index is used by Windows Explorer to quickly find files. Sometimes, rebuilding the search index can help resolve search-related issues. To rebuild the search index, go to the Windows Settings app, select "Search," click on "Searching Windows," and then click on "Advanced search indexing options." In the Indexing Options window, click on "Advanced," and then click on "Rebuild" under the Troubleshooting section. Follow the prompts to rebuild the search index.

    Check file indexing status: Ensure that the file types you are searching in Windows Explorer are included in the search index. In the Indexing Options window (as described in step 1), click on the "Modify" button, and make sure that the file types you want to search within are selected. If they are not selected, tick the checkbox next to the desired file types and click "OK" to include them in the search index.

    Verify file content indexing: Double-check that the file contents are being indexed by Windows. In the Indexing Options window, click on the "Advanced" button, switch to the "File Types" tab, locate the file type you are searching within, and ensure that the "Index Properties and File Contents" option is selected. If it's not selected, tick the checkbox and click "OK" to enable content indexing for that file type.

    Use alternative search tools: If the Windows Explorer search continues to have issues, you can try using alternative search tools like Everything Search, Agent Ransack, or FileLocator Lite. These tools offer advanced search capabilities and may provide better results for your search requirements.

    Please note: This is a user-to-user community forum. We are users just like you who help others. We are not employees of Microsoft.

    4 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-01-09T15:15:24+00:00

    After reading multiple message threads from people complaining that seach on Windows 11 is not working, I have determined that the most likely problem is due to disk cloning. When most people clone their Windows drive, they will typically chnage the boot sequence in BIOS to the new drive and keep their old Windows drive connected to the system in case there are issues with the new drive. Unfortunately, this leaves two disks on the system with the same volume ID. Windows search indexes the old D: drive but does not allow the new C: drive to be added to the search index even when the C: drive is manually added to the search index. To resolve the problem and keep the old drive connected to the system, use the DOS CMD command in administrative mode to force delete the partitions on the old drive (delete partition override). Note that the first time the system and reserved partition is deleted, a single merged partition is created which will need to be force deleted again. You will then be able to create a single D: partition on your old drive using Windows Create and Format Hard Disk partitions. Once you have reformatted your old D: drive, you can go into Settings==>Privacy & security==>Classic Customize search locations==>Modify and you can now add the folders in C: drive you want to index. Once you take OK, it will take awhile for Windows to index the C: drive.

    Microsoft MVPs, can you please add this solution to the search index message threads because many users who are cloning their drive are encountering this issue?

    2 people found this answer helpful.
    0 comments No comments
  3. Les Ferch 10,326 Reputation points Volunteer Moderator
    2023-05-17T03:47:03+00:00

    It's not difficult. You just have to ensure that the folder you're searching has been indexed and that you haven't stopped Explorer from using the index. First open the Indexing Options control panel and ensure your folder is indexed (or is a subfolder of an indexed location).

    Then check the Search options of your folder and make sure that first check box is NOT checked:

    Yes this is a confusing (and confounding) dialog. That first option indicates that it only has to do with "System files" but, in my experience, checking it simply stops Explorer from using the index regardless of what you're searching. So, don't check it.

    With the index created and enabled, you should get instantaneous search results. No need for batch files or PowerShell scripts.

    2 people found this answer helpful.
    0 comments No comments