Skip to content

Instantly share code, notes, and snippets.

@DanielSmon
Created March 15, 2021 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielSmon/cc6dbccd3cf514bd7781136b54b4a510 to your computer and use it in GitHub Desktop.
Save DanielSmon/cc6dbccd3cf514bd7781136b54b4a510 to your computer and use it in GitHub Desktop.
backup-drive.cmd
@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