Skip to content

Instantly share code, notes, and snippets.

@raresteak
Last active June 13, 2021 05:45
Show Gist options
  • Save raresteak/e22e690b6562883ebaffa14c5a72e5cd to your computer and use it in GitHub Desktop.
Save raresteak/e22e690b6562883ebaffa14c5a72e5cd to your computer and use it in GitHub Desktop.
WindowsDesktopBackup.bat
Rem Windows incremental backup of source to destination
Rem /D Copies files changed
Rem /E Copies directories and subdirectories, including empty ones.
Rem /Y Suppresses prompting to confirm you want to overwrite
Rem /I If destination does not exist and copying more than one file,assumes that destination must be a directory.
xcopy C:\Users\%username%\Documents\* E:\Backup\%computername%\%username%\Documents /D /E /Y /I
xcopy C:\Users\%username%\Desktop\* E:\Backup\%computername%\%username%\Desktop /D /E /Y /I
xcopy C:\Users\%username%\Downloads\* E:\Backup\%computername%\%username%\Downloads /D /E /Y /I
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment