Created
November 16, 2016 14:51
-
-
Save jangeador/56f654112cd7cdd61e3cd08f3221fbb8 to your computer and use it in GitHub Desktop.
Robust copy of files in Windows
This file contains hidden or 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
@echo off | |
SET SORC="\\server\share" | |
SET DEST="Z:\WHERE YOU WANT FILES TO GO" | |
SET LOG="Z:\THE LOG FILE.log" | |
ROBOCOPY %SORC% %DEST% /MIR /SEC /R:1 /W:1 /NP /LOG:%LOG% | |
@if errorlevel 16 echo ***ERROR *** & goto END | |
@if errorlevel 8 echo **FAILED COPY ** & 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 --Copy Successful-- & goto END | |
goto END | |
:END | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment