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
GTS Joe
  • 281

1 Answers1

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"
JosefZ
  • 13,855