When I executed the following loop, the value in %%a is not set to Result1 properly. What should I Do to correct this?
for /r %%i in (*.dll) do (
echo %%i
set Result1=
for /F "delims=" %%a in ('corflags "%%i" ^| findstr "PE32"') do set Result1=%%a
echo %Result1%
)
The problem lies in the way batch interprets script. You should enable and use Delayed Expansion: