How to find all files that do NOT contain specific string in windows environment Visual Studio or any other IDE?
I finally found solution to find all files with certain extension that do NOT contain a specific string, I was looking for a solution to this for a long time, and it works great and is free. Hope this helps others who are trying to do the same.
GOTO EndComment
1st Change source, destination, extension and string to your needs.
2nd Remove ECHO from line 19 (If you want to make a copy of those
specific files that contain the string to destination folder)
3rd Save this piece of code on a file file with extension .cmd
and run it to get results (just double click on file).
:EndComment
@echo off
setlocal
set source=c:\Users\youruseraccount\Documents\Visual Studio 2012\PathofProject\
set destination=c:\foundFilesWithoutString\
set extension=*.aspx.cs
set string=Security
for /f "tokens=*" %%G in ('dir /s "%source%\%extension%" /a:-d /b') do (
find /c /i "%string%" "%%G" > NUL || (
ECHO copy "%%G" "%destination%"
)
)
pause