6

I need to search for an old file in a large directory.
Unfortunately, the index isn't able to locate it, and I only have keywords to search for which may be in the body of the file rather than the filename.

I'd like to perform a non-indexed search (I know this will take a long time to search), because I'm certain the file is there somewhere, and I do not have any other copies of this file.

I know you could circumvent the index in previous versions of Windows, but I can't seem to figure out how to do it in Windows 10.
Perhaps I've simply forgotten how to do it. ;)

Giffyguy
  • 1,062

4 Answers4

3

I just stumbled upon this question and needed the same.

I did not find a native windows solution for this via the UI. I achieved this by using 3rd party applications. (CSearcher, FileSeek, ...)

However there is a method using PowerShell. You can search using Get-ChildItem and pipe it into the Select-String cmdlet

Example:

Get-ChildItem –Path D:\MyFolder -Include *filename* -Exclude *.pdf -Recurse -ErrorAction SilentlyContinue | Select-String -Pattern "MyContentPattern"
eKKiM
  • 147
3

In file explorer, check the option View | Options | Search | Always search file names and contents (this might take several minutes).

1

I cannot believe something that should be so easy to do, is impossible to achieve with Windows.

Yet again, Windows developers just have no UX experience or care for the basic necessities we have to face every day.

Windows search is a sick joke IMO and unless you're in "the know", you won't know the tricks on how to get this hyroglyphic designed system to work.

Enter in the Windows Search content saga. Like a simple tick of the so called "advanced" (ooh scary... don't tick that option!) File Contents option should be sufficient to allow the operating system to know that what you're about to type in the search bar, will actually search for both files and contents, for said string provided. So simple right?

Oh no, agasp! It lists every single damn file in the folder!

#foreheadslap #foreheadslap #foreheadslap #foreheadslap

So here my fellow humans, and I say that with such utter respect to the human race that wants / screams / demands even, the simplest of tasks to just work and not have to Google every damn instruction and blog out in the universe just to find one simple answer - HOW DO I DAMN FIND MY FILES USING THIS DAMN WINDOWS SEARCH!?!?

Well enter in the simple "~" tilde character. (seriously - how the effen are we supposed to know you have to use just one single character to mean the term "content"!?!).

#sigh

Here my friends, is your saviour. Forget the "content:" command. It does NOT WORK!

~="your search string"

That's right folks, the simple "~" character with the "=" sign and YOUR search string with any character you want and yes inside those two bloody double-quote characters, will finally find you the files you've been searching years for!

Thank me later.

Fandango68
  • 133
  • 4
0

The findstr command line tool works very well for text searches on Windows. It supports regex patterns and wildcards for file names.

Example to search: findstr /m /s /i pattern *somefile*

  • /s search all files in the current directory and subdirectories
  • /i case insensitive
  • /m print only the name of the files with the pattern
richk
  • 231