robocopy returns a bit map
This is the batch file code I usually use:
set SOURCE= ...
set DESTINATION= ...
robocopy /MIR /LOG:example.robocopy.log.txt %SOURCE% %DESTINATION%
@echo robocopy exit code: %ERRORLEVEL%
@if %ERRORLEVEL% GTR 3 ( echo robocopy ERROR )
@if %ERRORLEVEL% GTR 3 ( exit %ERRORLEVEL% )
@set ERRORLEVEL=0
You could also do a "goto" and not exit.