If I use the following three lines by themselves, it works as expected:
Code: Select all
find /c "<errors>0</errors>" %recentBK%
if %errorlevel% equ 1 set today=failed
echo %today%
As soon as I put this within a condition, the %errorlevel% command no longer works (see below). I am certain the condition is met before expecting the stuff within the parenthesis to work. How can I get %errorlevel% to behave correctly within a condition statement? Or, at least find the correct way to get the below logic to work:
Code: Select all
if %BKfiledate%==%date% (
find /c "<errors>0</errors>" %recentBK%
if %errorlevel% equ 1 set today=failed
echo %today%
)