findstr returns 0 if something is found, and 1 if nothing is found. You just flipped your check.
, Windows , :
>dir | findstr ".sln"
15.01.2009 16:37 33.844 Project.sln
>echo %ERRORLEVEL%
0
>dir | findstr ".slngimpf"
>echo %ERRORLEVEL%
1
Btw,
if errorlevel 0 andthencontinuewithwhatever
, script :
set errorlevel=0
% errorlevel%.
(edit) : , if errorlevel , . , , , :
someCommand
if errorlevel 10 ...
if errorlevel 9 ...
if errorlevel 0 ...