Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Windows Server 2008 and I need to create a Batch file (.bat) to search for a given string in 20.000 to 30.000 files located all in one folder in the same level (without subfolders).

I have been searching and reading around but I couldn't find anything to do it.

Trying it with this without success:

@echo off for /r "delims=|" %%i in (*) do  (    
    findstr /m /C:"34444" %%i

share|improve this question
This should point you at the commandline tools you'd need to use, depending on what you're looking for it should only take one command, shouldn't need a batch file:… – Tim Radcliffe Jan 15 '14 at 13:01
I have updated the question. – Alvaro Jan 15 '14 at 13:07
up vote 1 down vote accepted

From batch

START cmd.exe /k "Findstr -m "34444" *.*"

From command line

Findstr -m "34444" *.*"

also from powershell, create named batch file *.cmd extension containing following content. (remember to change the gci path 'your folder path'.

@PowerShell -ExecutionPolicy Bypass -noexit -Command Invoke-Expression $('$args=@(^&{$args} %*);'+[String]::Join(';',(Get-Content '%~f0') -notmatch '^^@PowerShell.*EOF$')) & goto :EOF
gci -path 'c:\your folder path\' -fi '*' | Select-String -patt "34444" | select Filename, LineNumber | Format-Table -a

call batch file *.cmd to run the powershell search.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.