¿Alguien sabe porqué no obtengo el mismo resultado en estos dos trozos de
código en un archivo de proceso por lotes (.bat)?:
echo *** ITERATIVE ***
echo.
set /a ERROR=0
for %%n in (1 2 3) do (
call non_existent_command
set /a ERROR ^|= %ERRORLEVEL%
echo ERROR is %ERROR% and ERRORLEVEL is %ERRORLEVEL%)
echo *** SEQUENTIAL ***
echo.
set /a ERROR=0
call non_existent_command
set /a ERROR ^|= %ERRORLEVEL%
echo ERROR is %ERROR% and ERRORLEVEL is %ERRORLEVEL%
call non_existent_command
set /a ERROR ^|= %ERRORLEVEL%
echo ERROR is %ERROR% and ERRORLEVEL is %ERRORLEVEL%
call non_existent_command
set /a ERROR ^|= %ERRORLEVEL%
echo ERROR is %ERROR% and ERRORLEVEL is %ERRORLEVEL%
Leer las respuestas