Page 1 of 1

Search for file content in a folder

Posted: 22 Jul 2021 07:19
by soportebh
Hello, I have a folder with many files, about 250k, these files cannot be organized in subfolders because other systems need to be there.
I need to search for a string in the content of the files with today's modified date.
I don't know how to do it, can you help me?

Re: Search for file content in a folder

Posted: 22 Jul 2021 15:39
by aGerman

Code: Select all

for /f "delims=" %%i in ('forfiles /p "C:\your\folder" /d +0 /c "cmd /c if @isdir==FALSE findstr /mc:0x22your search string0x22 @path"') do echo "%%i"
Note that FINDSTR won't find anything in files containig other data than plain text.

Steffen