Today we’re going to cover a geeky technical bit that can give every reader with Windows 7 an easy backup for their files. I think this might work for vista and it may partially work for XP, but it’s not recommended.
There are two functions for backups and they are separate. The most common is the “oops” factor where you’ve just modified or deleted a file in a manner that you wish you didn’t. The less common is the “disaster recovery” factor where your computer or it’s hard drive have been destroyed and you have the potential for loosing all your data.
Dealing with the second point first (to get it out of the way), you need to make other plans. This article won’t help. Maybe you want a RAID (Redundant Array of Inexpensive Disks) setup for your files. Maybe you want to backup important files to external media. You won’t find your answer in this article. Your data is precious and you should think about that when you think about backups.
Now that the elephant has left the room, we can deal with the meat of the article: The “Shadow Copy” Backup. I didn’t name it. Microsoft calls it the “Shadow Copy” service and it was introduced (in a somewhat broken form) with windows XP. What it does is subtle and cool: it creates a “checkpoint” on the disk that you can later return to if you goof up. It seems to be primarily geared to fixing problems whereby the installation of software or drivers have messed up the computer. It’s somewhat good at that. Most Windows install programs are already set to use Shadow Copy if it’s turned on.
What we’re going to do is turn it on for “all” files rather than just system files and then setup a “task” to automatically take these snapshots without us having to remember them. Done this way it can function somewhat like “Time Travel” for macintosh — allow us to view alternate versions of our files over time.
First, we need to turn on the service. For this you need to open your Control Panel and Select “System and Security” then “System” and from that (on the left) select “System protection.” On this panel, select your boot hard drive (and you can then apply this to any other hard drives you’d like to also use this system) and click on the “Configure” button. I have given it about 10% of the available space — which is a sensible setting. See the image below (and feel free to click to see a larger version).
You can create manual snapshots with the “Create” button in this dialog, but you’re not going to remember to do this often enough (I certainly don’t) and a backup each time you install software isn’t very often, so we need to now create the automatic portion of your backup.
Create a file in your home directory or in a subdirectory of your home directory (I call my directory scripts). We’re going to write this in Visual Basic since a) I don’t know how to do it otherwise; b) you can create the script with just notepad; and c) all Windows machines are already able to run Visual Basic scripts. The file needs to end in “.vbs” to work. I call mine “CreateRestorePointSilent.vbs” and you can cut-n-paste the following into it:
If WScript.Arguments.Count = 0 Then Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " Run", , "runas", 1 Else GetObject("winmgmts:\\.\root\default:Systemrestore").CreateRestorePoint "Scripted restore point", 0, 100 End If
Once you’ve saved this file, open the Control Panel again, select “System and Security” again and from there select “Administrative Tools”. On this panel, find and open “Task Scheduler.” From there you will make sure that “Task Scheduler Library” is selected and then select “Create a Basic Task” from the right-hand panel. NB: in this image, the center panel already indicates that have created a task called “Create Checkpoint” … your screen will not include this. This is also the place where your computer records periodic actions it is performing — you might take a minute to look at the center list.
Click next and you will be prompted to select the trigger. You can choose “once a day” here or “when the computer starts.” I’m choosing the latter and we’ll return to this later.
Click next again, select “Start a Program” and select your script. The next step finishes this dialog, but check the “open properties” checkbox or open the properties of your new task. The last step is to add another trigger to make it run a bit more often. Select the triggers tab, select “New…” and create a “daily” item for sometime when you are normally awake, but near the middle or end of your day. This will make a backup for days when you do not shutdown your computer. Note that I have also checked the safety feature to kill the task if it runs longer than 30 minutes.
Once you have done all this, you will be able to select “Show other versions” from the right-click menu of files. If other versions of the file exist, you will be given the opportunity to recover them. You will also have the opportunity to “revert” the system to an earlier backup should a driver installation go badly.
Note that your files will revert as well if you consider doing this.
By that, I mean that reverting to a configuration of the system that was made 10 minutes ago during a failed install isn’t likely to loose too much of your work, but care should be taken if you’re considering reverting to a version of the system that was made several days ago. You might want to back up your work to a USB key in that case.
As a possible downside, installations (which create checkpoints) take somewhat longer because I’m keeping dozens of checkpoints instead of one or two. Another possible caveat is that large media files that come and go on your hard drive will have a detrimental effect to the number of shadow copy backups you can keep. The system will keep as many backups as fit in the amount of disk you have selected it to use. When the shadow copy system is seen to be using more space that allotted, it will delete backups until the space used by the backups is under set amount.
Another relevant caveat is that “defragging” your hard drive will drastically reduce the number of shadow copies that are kept. I don’t have a complete explanation other than “This is what I have observed” and “This is what I have read.” Something along the lines of moving the blocks for the defragging can erase (accidentally or on purpose) the shadow copies.
Regardless of these small caveats, this system has saved my butt a couple of times recently. With 10% of the drive allocated an my usage of the machine, it tends to only have a few days to a week of data. In my case I keep roughly 2 backups per day (in addition to any that are created by installing or deinstalling software). More backups can use more space (although not always) and more backups can create (I believe) longer pauses when installing software.
It is not a substitute for regular offline backups of important work product that you should already be doing, but it has a fine granularity and a convenience of use (only a few minutes to recover a file) make it an excellent addition to any windoze computer.