Search for file content in a folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
soportebh
Posts: 1
Joined: 22 Jul 2021 07:11

Search for file content in a folder

#1 Post by soportebh » 22 Jul 2021 07:19

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?

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Search for file content in a folder

#2 Post by aGerman » 22 Jul 2021 15:39

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

Post Reply