Created
March 15, 2021 01:29
-
-
Save DanielSmon/cc6dbccd3cf514bd7781136b54b4a510 to your computer and use it in GitHub Desktop.
backup-drive.cmd
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
@ECHO OFF | |
IF X%1==X GOTO INVALID_ARGS | |
IF X%2==X GOTO INVALID_ARGS | |
GOTO:RUN | |
:INVALID_ARGS | |
ECHO Invalid arguments | |
ECHO. | |
ECHO Usage: %~n0 F E | |
ECHO. | |
ECHO Where F is source drive (F:) and E is destination (E:). | |
GOTO:EOF | |
:RUN | |
SET SOURCE=%1 | |
SET DEST=%2 | |
robocopy %SOURCE%:\ %DEST%:\ *.* /S /DCOPY:DA /COPY:DAT /MIR /NP /TEE /UNILOG:%SOURCE%-to-%DEST%.log /XD "Recycle Bin" "System Volume Information" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment