6

I can use the following to search for text files that contain the word "string" from the Windows Command Prompt:

C:\>findstr /spin /c:"string" *.txt 

What if I want to search a sub-directory? The following doesn't work:

C:\>findstr /spin /c:\Users\My Name\Desktop"string" *.txt 

Is it possible to search a specific sub path using findstr? I know I can do the following, but I'm trying to avoid having to change directories first:

C:\Users\My Name\Desktop>C:\>findstr /spin /c:"string" *.txt 
2
  • 1
    findstr /spin /c:"string" "c:\Users\My Name\Desktop\*.txt" Commented Aug 26, 2016 at 18:28
  • If you post this as an answer I'll accept it as it's just what I was looking for. Commented Aug 26, 2016 at 18:57

1 Answer 1

5

Your question appears to me quite bit vaguely formulated.
Read program documentation in any doubt (findstr /? or http://ss64.com/nt/findstr.html in this case).

findstr /spin /c:"string" "c:\Users\My Name\Desktop\*.txt" 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.