Being a computer enthusiast is both a blessing and a menace. We constantly change components and reap the performance benefits, but we're stuck with the time consuming tasks of backing up and recovering our important data in the new setup. After going through 6 reformats in the past 4 months, I've decided to take the effort out of the process. It's a bit more work to start, but afterwards, a simple click of a button (or scheduled task) can back up any and every file you wish.
Problems with manual backup:
- Because it's on a file-by-file basis, it's sometimes difficult to make sure you've included everything everytime
- It's difficult to remember where all the backed-up files were originally located (save game files in particular) when you go to restore them
- It's time consuming
The solution:
1) xcopy command
2) .BAT file
3) Windows task scheduler
xcopy Command
xcopy is a command-line function built into Windows that can be used to copy files/directories in a wide variety of ways. A full explanation can be read here.
For the purpose of this guide, I'll be doing seperate xcopy commands for each file/directory so that I can easily add/remove the backup of any given element. I am also using the /e parameter to include all empty directories, and the /y parameter to eliminate the "Overwrite files?" prompt.
Notes: When using xcopy, I've found it works best when you leave the \\ off of your source and be sure you include the \\ on your desination. This basically ensures you copy everything within the source directory, and ensures that your destination is a directory, not a file. You'll also want to surround all paths with " " to ensure the argument is read as a single string (if there are spaces in the path you must use quotes).
This command will yield a directory in C:\\ named Dest, and it will contain all files and subdirectories from Source.
For my backup method, I'll be copying to a different hard disk, but I'd like to keep the same path as the original. Why not just put it all in one folder? It's basically a preference thing. If I keep all the original paths intact, I just have to drag a single backup folder onto my freshly re-installed Windows. All the backed-up files will go back to their original places, with all directories and structures in place (very useful for saved game backups or custom configurations. It's a pain to locate all the save folders every time).
The model I use:
Even though I'll have two tiers of useless directories (Saves is the only one that's really needed) the other directories act as placeholders and keep the original filepath intact.
.bat File
A batch (.bat) file is a basically a list of commands to be executed. For this guide, I'll be using a batch file as a means to execute a series of xcopy commands that correspond to my different files. This is both the easiest and hardest part. Easiest because you just have to put repeated xcopy commands, hardest because any files you don't include in your batch file, won't get backed up. You have to be absolutely sure you include all important items in your list of xcopy commands.
After you have your full list of backup commands, save it under whatever name you'd like, but include a .bat extension. For simplicity, I used backup.bat.
Windows task scheduler
With the creation of your new backup batch file, you can use the Windows task scheduler to run a backup on a regular, scheduled basis. Here's how...
Restoration
After backing up all your files, you can easily make another file, restore.bat, with the source and destination drives reversed (ie. copying from D:\\ to C:\\). By running restore.bat file with a freshly formatted drive, you're able to put everything back in their original places. However, as mentioned before, I always backup to the exact same path as the original, so that all I have to do is drag the backed up files onto my C:\\ and everything gets copied to the correct place.
Disclaimer:
As with all FAQ's, this is meant as a guide only. Myself and Overclock.net shall not be responsible for any undesired effects as a result of the procedures described in this guide.
Problems with manual backup:
- Because it's on a file-by-file basis, it's sometimes difficult to make sure you've included everything everytime
- It's difficult to remember where all the backed-up files were originally located (save game files in particular) when you go to restore them
- It's time consuming
The solution:
1) xcopy command
2) .BAT file
3) Windows task scheduler
xcopy Command
xcopy is a command-line function built into Windows that can be used to copy files/directories in a wide variety of ways. A full explanation can be read here.
For the purpose of this guide, I'll be doing seperate xcopy commands for each file/directory so that I can easily add/remove the backup of any given element. I am also using the /e parameter to include all empty directories, and the /y parameter to eliminate the "Overwrite files?" prompt.
Notes: When using xcopy, I've found it works best when you leave the \\ off of your source and be sure you include the \\ on your desination. This basically ensures you copy everything within the source directory, and ensures that your destination is a directory, not a file. You'll also want to surround all paths with " " to ensure the argument is read as a single string (if there are spaces in the path you must use quotes).
Code:
xcopy /e /y "C:\\Source" "C:\\Dest\\"
For my backup method, I'll be copying to a different hard disk, but I'd like to keep the same path as the original. Why not just put it all in one folder? It's basically a preference thing. If I keep all the original paths intact, I just have to drag a single backup folder onto my freshly re-installed Windows. All the backed-up files will go back to their original places, with all directories and structures in place (very useful for saved game backups or custom configurations. It's a pain to locate all the save folders every time).
The model I use:
Code:
xcopy /e /y "C:\\Program Files\\Game1\\Saves" "X:\\Program Files\\Game1\\Saves\\"
.bat File
A batch (.bat) file is a basically a list of commands to be executed. For this guide, I'll be using a batch file as a means to execute a series of xcopy commands that correspond to my different files. This is both the easiest and hardest part. Easiest because you just have to put repeated xcopy commands, hardest because any files you don't include in your batch file, won't get backed up. You have to be absolutely sure you include all important items in your list of xcopy commands.
Code:
xcopy /e /y "C:\\Documents" "D:\\Documents\\"
xcopy /e /y "C:\\Music" "D:\\Music\\"
xcopy /e /y "C:\\Saves" "D:\\Saves\\"
Windows task scheduler
With the creation of your new backup batch file, you can use the Windows task scheduler to run a backup on a regular, scheduled basis. Here's how...
Now, you'll have backups of anything you deem important, as often as you deem important. You can add and remove files at any time by simply editing your batch file. Hopefully someone can put it to good use, and save some headaches and lost work.
1) Control Panel -> Scheduled Tasks
2) Click "Add Scheduled Task"
3) Click "Next" and then "Browse" and find your backup batch file.
4) Set up the times that you want the task to run and you're finished.
Restoration
After backing up all your files, you can easily make another file, restore.bat, with the source and destination drives reversed (ie. copying from D:\\ to C:\\). By running restore.bat file with a freshly formatted drive, you're able to put everything back in their original places. However, as mentioned before, I always backup to the exact same path as the original, so that all I have to do is drag the backed up files onto my C:\\ and everything gets copied to the correct place.
Disclaimer:
As with all FAQ's, this is meant as a guide only. Myself and Overclock.net shall not be responsible for any undesired effects as a result of the procedures described in this guide.


