@echo off rem rem this script will backup the user's files to a separate disk. rem echo. echo This backup procedure will backup your "My Documents" folder, and echo all of your other files in echo. echo %USERPROFILE% echo. echo (this includes settings and email files) to an external drive (like echo a "flash drive" or "usb drive"). Note that you can run this backup echo several times, and it will only copy newer files that have been echo changed, skipping files that haven't changed. (If you delete echo a file from your computer, it won't delete the backup file, but if echo change a file on your computer, the new version overwrites the echo backup version. echo The log file and screen will list the new files that are backed up, echo and it will list "extra files" that no longer exist in the source echo but are still in the backup. You can delete these extra files by echo adding a /xx to the list of command options.) echo. set drivetmp=F set /p drivetmp="What is the drive letter to backup to (default: %drivetmp%)? " echo. echo backing up from "%USERPROFILE%" to "%drivetmp%:\%USERNAME%_Backup" echo echo Please wait until backup is completed. rem pause set OPTIONS=/copy:datos /e /r:0 /xj /xd cache* /xd temp* /xd tmp* /xd dmrccache* /np /ndl /eta /xf Robocopy_backup.log /tee /log+:Robocopy_backup.log robocopy "%USERPROFILE%" "%drivetmp%:\%USERNAME%_Backup" %OPTIONS% echo. echo Backup completed. pause exit rem Note: it is crucial to exclude the log file from the backup, or it gets stuck in an infinite loop! rem the robocopy /copyall doesn't work if transferring from NTFS to FAT32 rem the above /xd commands are case-insensitive, and exclude all subdirectories that begin rem with the following character pattern. In particular, we are excluding subdirectories rem like C:\...\Mozilla\...\Cache*, because they change names frequently, and the old rem cached files will build up relatively quickly until the backup drive fills up.