G
GrayB
Hi all,
Hmnn the ERRORLEVEL variable don't work within a FOR loop, right? Or
did I get the syntax wrong. For example:
-----------------------------
@echo off
setlocal
FOR /L %%i in (1,1,10) do (
ping -n 1 10.10.10.%%i | find /i "Reply" > NUL
echo [%ERRORLEVEL%]
)
-----------------------------
that %ERRORLEVEL% is always NUL, as in nothing. This variable holds
the expect value if I do the test without the FOR loop as just:
-------------------------
ping -n 1 10.10.10.%%i | find /i "Reply" > NUL
echo [%ERRORLEVEL%]
-------------------------
where the result is consistently [0] for success and [1] for failure.
Thanks all!
Hmnn the ERRORLEVEL variable don't work within a FOR loop, right? Or
did I get the syntax wrong. For example:
-----------------------------
@echo off
setlocal
FOR /L %%i in (1,1,10) do (
ping -n 1 10.10.10.%%i | find /i "Reply" > NUL
echo [%ERRORLEVEL%]
)
-----------------------------
that %ERRORLEVEL% is always NUL, as in nothing. This variable holds
the expect value if I do the test without the FOR loop as just:
-------------------------
ping -n 1 10.10.10.%%i | find /i "Reply" > NUL
echo [%ERRORLEVEL%]
-------------------------
where the result is consistently [0] for success and [1] for failure.
Thanks all!