The Windows FINDSTR command is horribly documented. There is very basic command line help available through FINDSTR /?
, or HELP FINDSTR
, but it is
/D tip for multiple directories: put your directory list before the search string. These all work:
findstr /D:dir1;dir2 "searchString" *.*
findstr /D:"dir1;dir2" "searchString" *.*
findstr /D:"\path\dir1\;\path\dir2\" "searchString" *.*
As expected, the path is relative to location if you don't start the directories with \
. Surrounding the path with "
is optional if there are no spaces in the directory names. The ending \
is optional. The output of location will include whatever path you give it. It will work with or without surrounding the directory list with "
.