Here's your code snipped. Had to fix couple of typos from the original. Extra ' in front of 2 and missing % for %a.
Code: Select all
rem @echo off
rem setlocal enabledelayedexpansion
set "err="
for /f "delims=|" %%a in (errorlist.txt) do (
for /f "delims=|" %%b in ('2^>nul findstr /C:"%%a" "%cd%\Logs\*.*"') do (
set "err=1"
set "str=%%b"
setlocal EnableDelayedExpansion
echo !str:~0,-1!
endlocal
)
)
if defined err goto :errordisplay
:errordisplay
@echo errors found
set "err=1"
set "str=%b"
setlocal EnableDelayedExpansion
echo !str:~0,-1!
endlocal
) )
C:\Users\Bobby\AppData\Local\Android\Sdk\platform-tools>(for /F "delims=|" %b in ('2>nul findstr /C:"ERROR! Hasn't enough continuous memory in memoryPool " "C:\Users\Bobby\AppData\Local\Android\Sdk\platform-tools\Logs\*.*"') do (
set "err=1"
set "str=%b"
setlocal EnableDelayedExpansion
echo !str:~0,-1!
endlocal
) )
C:\Users\Bobby\AppData\Local\Android\Sdk\platform-tools>(for /F "delims=|" %b in ('2>nul findstr /C:"isImpairment: 1 " "C:\Users\Bobby\AppData\Local\Android\Sdk\platform-tools\Logs\*.*"') do (
set "err=1"
set "str=%b"
setlocal EnableDelayedExpansion
echo !str:~0,-1!
endlocal
) )
C:\Users\Bobby\AppData\Local\Android\Sdk\platform-tools>if defined err goto :errordisplay
errors found