robocopy Errorlevel

You can use this information in a batch file to report the most serious anomalies, as follows:

if errorlevel 16 echo ***FATAL ERROR***  & goto end
if errorlevel 8  echo **FAILED COPIES**  & goto end
if errorlevel 4  echo *MISMATCHES*       & goto end
if errorlevel 2  echo EXTRA FILES        & goto end
if errorlevel 1  echo Copy successful    & goto end
if errorlevel 0  echo --no change--      & goto end
:end

Alternatively, full details of the return code could be reported as follows:

if errorlevel 16  echo  ***FATAL ERROR***  & goto end
if errorlevel 15  echo FAIL MISM XTRA COPY & goto end
if errorlevel 14  echo FAIL MISM XTRA      & goto end
if errorlevel 13  echo FAIL MISM      COPY & goto end
if errorlevel 12  echo FAIL MISM           & goto end
if errorlevel 11  echo FAIL      XTRA COPY & goto end
if errorlevel 10  echo FAIL      XTRA      & goto end
if errorlevel  9  echo FAIL           COPY & goto end
if errorlevel  8  echo FAIL                & goto end
if errorlevel  7  echo      MISM XTRA COPY & goto end
if errorlevel  6  echo      MISM XTRA      & goto end
if errorlevel  5  echo      MISM      COPY & goto end
if errorlevel  4  echo      MISM           & goto end
if errorlevel  3  echo           XTRA COPY & goto end
if errorlevel  2  echo           XTRA      & goto end
if errorlevel  1  echo                COPY & goto end
if errorlevel  0  echo    --no change--    & goto end
:end

Quelle: robocopy.doc

Post to Facebook Post to Twitter Post to MySpace Post to Ping.fm Send Gmail Post to Google Buzz Post to LinkedIn Post to Delicious