1

Background: I have programming experience, but have not programmed in years.

My place of employment (a State prison) does not allow me to download programming tools/environments (internet access is severely curtailed).

I need to search the contents of a folder for phrases contained within files contained within that folder. For example, in a given (network) folder, I want to search all the MS Word docs in the folder for a phrase such as "knee brace."

Is there a way to do this -- at the command line, for example (assuming such is still available in Windows 10)? All I would need is the name of which file[s] contained the phrase provided.

3 Answers 3

1

Yes the command prompt is certainly still a viable solution in Windows 10. Either run cmd or right click the start menu to find it.

this guide appears like it may be able to help you.

1
  • 1
    Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.
    – DavidPostill
    Apr 27, 2019 at 6:21
1

Use the findstr command. For example:

C:\...> findstr /S /C:"knee brace" * | more

The /S option will search the current directory and all sub-directories. If you want to save the results to a file, you can use command redirection:

C:\...> findstr /S /C:"/knee brace" * > results.txt
1
  • For a network folder, does the "/C:" still apply? If not, what should that look like? Something like "///bla/bla/bla"? (I won't be able to try it out until Monday at the earliest) Apr 27, 2019 at 16:51
1

To search Word documents, I think you'll need some scripting. PowerShell is Windows built-in command/scripting environment. A great example is here.

Keith

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.