My requirement is simple, i just want to scan all the files in the current directory for a particular string and if that string is found i just want a display saying "String is found" otherwise "String not found"
    @ECHO OFF
    for %%f in (C:\Users\aalvoor\Desktop\BatchScript\*) do (
    echo File is %%f
    find /c "defaultModel" %%f >NUL
    if %errorlevel% equ 1 (echo File is notfound) else (echo String is found)
    )
But the problem is it works when i am not putting it in a for loop but when i put it in for loop for some reason for every file i get a message String is found which is not true.
 
    