Advertisement
Falkerz

BackupScript-DatumVonCopy1.1

Oct 29th, 2015
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. @echo off
  2. :: variables
  3. set drive=E:\BACKUPS
  4. for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
  5. set dow=%%i
  6. set month=%%j
  7. set day=%%k
  8. set year=%%l
  9. )
  10. set datestr=%month%.%day%.%year%
  11. set backupCmd=xcopy /s /c /d /e /h /i /r /y
  12.  
  13. echo ########################################
  14. echo # Files Backup Script #
  15. echo ########################################
  16. echo .
  17.  
  18. :: Documents directory
  19. echo # Backing up Documents directory... #
  20. %backupCmd% "%USERPROFILE%\Documents" "%drive%\%datestr%\Documents"
  21. echo # Documents directory backup complete! #
  22. echo .
  23.  
  24. :: Pictures directory
  25. echo # Backing up Pictures directory... #
  26. %backupCmd% "%USERPROFILE%\Pictures" "%drive%\%datestr%\Pictures"
  27. echo # Pictures directory backup complete! #
  28. echo .
  29.  
  30. :: Videos directory
  31. echo # Backing up Videos directory... #
  32. %backupCmd% "%USERPROFILE%\Videos" "%drive%\%datestr%\Videos"
  33. echo # Videos directory backup complete! #
  34. echo .
  35.  
  36. echo ########### Backup complete! ###########
  37. @pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement