Created
January 6, 2017 09:16
-
-
Save jmd/b103a121ec035cf889eb604b29d8a535 to your computer and use it in GitHub Desktop.
Robocopy wrapper fixing return code issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM ============================================================ | |
REM Wrapper for robocopy fixing the exit code issue | |
REM | |
REM Robocopy can return a non zero exit code even when there is | |
REM no error which can be problematic when integrated in a build | |
REM tool chain. | |
REM | |
REM Brocopy addresses that issue by calling robocopy but | |
REM returning 0 when successfull and 1 otherwise. | |
REM ============================================================ | |
robocopy %* | |
REM Exit with 1 when errorlevel >= 8 and 0 otherwise | |
if ERRORLEVEL 8 GOTO error | |
exit /B 0 | |
error: | |
exit /B 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment