Skip to content

Instantly share code, notes, and snippets.

@M3ales
Created November 5, 2017 13:44
Show Gist options
  • Save M3ales/eec95c6e0d899d7693226ef542c06879 to your computer and use it in GitHub Desktop.
Save M3ales/eec95c6e0d899d7693226ef542c06879 to your computer and use it in GitHub Desktop.
Searches folder and subfolder, the content of each file for the specified string, then prints the filename, and line+character offset. To use regex, add the /r flag to both findstr checks.
@echo off
:start
echo =============
echo New Search
echo =============
set /p "search=Search String:"
echo --
findstr /s /m %search% *.*
echo ----------
echo \\\\\\\
echo Details
echo ///////
echo ----------
findstr /s /n /o /p %search% *.*
echo =============
pause
goto start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment