16

I can't find any .txt, .php, .cs, .html, etc files using the 'search by file content' option in the searchbar in Windows Server 2012 R2.

I can't find the File Service Role.
I can't find the Windows Search service in Services.
I have checked the advanced option "File content".

Glorfindel
  • 4,089
  • 8
  • 24
  • 37

5 Answers5

20

I decided to provide screenshots, as Windows Server features and roles are now in a single interface and it's not obvious where to look.

Step 1. Enable Windows Search Service feature

Step 2. Enable search in contents

  • @Ramhound thanks for your review. I've updated the post text – Viacheslav Shchupak Feb 10 '17 at 13:15
  • In which case why not just [update the answer](https://superuser.com/a/710934/95106) with the images rather than leaving a duplicate answer? – user692942 Apr 10 '17 at 08:34
  • 1
    @Lankymart Does one get points for up-votes on an answer that one only edits rather than posts? I found the screenshots much more helpful than the original answer, which I had already found. – BlueMonkMN Sep 20 '17 at 13:56
  • @BlueMonkMN no, but if that's the end-game with answering, then the StackExchange communities are not for you. – user692942 Sep 20 '17 at 14:00
  • 1
    @Lankymart The purpose of assigning points is to give proper incentives for desired activities. So of course the scoring of answers should be considered in explaining why people choose a particular course of action. Whether that's one's ultimate motive shouldn't matter much otherwise there's little purpose in assigning points in the first place. Even if points aren't this answerer's motive, I think it's important for them to see how much the screenshots mattered. I suppose this should be discussed on meta.superuser.com instead of here. If another reply is warranted, maybe I'll take it there. – BlueMonkMN Sep 20 '17 at 14:19
7

In the explorer menu

View -> Options -> Change Folder And Search Options
Folder Options -> Search -> Check Always Search File names and Contents ....
  • 3
    Also check that you have the `Windows Search` feature installed (in Server Manager). And then check which locations are indexed in `File Explorer` > `Search` > `Advanced Options` > `Change indexed locations` – bounav Jun 06 '14 at 11:08
  • 2
    @bounav - Of course, look at `File Explorer` > `Search` > `Advanced Options` because that's the obvious place to find the configuration for windows search. Not. Thanks! – davidbak Mar 25 '16 at 03:36
4

findstr /S /L /M /C:"DocumentImportClass" .

search file content into folder and sub folders in windows

Vikash
  • 141
  • 1
-1

1+ for Vikash's command.

I would also add that /I to make it case-insensitive

findstr /S /L /M /I /C:"TextToSearch"

-1

The easiest way that worked for me was to select all the files where you suspect the string to be present, then right click and select open with notepad++. Once all the files are open in different tabs, go to any file tab and do Ctrl+F, type your string and select Find All in All Opened Documents and there you go!