Windows 7 Shadow Copy Backup Can be like Time Travel

Today we’re going to cov­er a geeky tech­ni­cal bit that can give every read­er with Win­dows 7 an easy back­up for their files.  I think this might work for vista and it may par­tial­ly work for XP, but it’s not recommended.

There are two func­tions for back­ups and they are sep­a­rate.  The most com­mon is the “oops” fac­tor where you’ve just mod­i­fied or delet­ed a file in a man­ner that you wish you did­n’t.  The less com­mon is the “dis­as­ter recov­ery” fac­tor where your com­put­er or it’s hard dri­ve have been destroyed and you have the poten­tial for loos­ing all your data.

Deal­ing with the sec­ond point first (to get it out of the way), you need to make oth­er plans.  This arti­cle won’t help.  Maybe you want a RAID (Redun­dant Array of Inex­pen­sive Disks) set­up for your files.  Maybe you want to back­up impor­tant files to exter­nal media.  You won’t find your answer in this arti­cle.  Your data is pre­cious and you should think about that when you think about backups.

Now that the ele­phant has left the room, we can deal with the meat of the arti­cle: The “Shad­ow Copy” Back­up.  I did­n’t name it.  Microsoft calls it the “Shad­ow Copy” ser­vice and it was intro­duced (in a some­what bro­ken form) with win­dows XP.  What it does is sub­tle and cool: it cre­ates a “check­point” on the disk that you can lat­er return to if you goof up.  It seems to be pri­mar­i­ly geared to fix­ing prob­lems where­by the instal­la­tion of soft­ware or dri­vers have messed up the com­put­er.  It’s some­what good at that.  Most Win­dows install pro­grams are already set to use Shad­ow Copy if it’s turned on.

What we’re going to do is turn it on for “all” files rather than just sys­tem files and then set­up a “task” to auto­mat­i­cal­ly take these snap­shots with­out us hav­ing to remem­ber them.  Done this way it can func­tion some­what like “Time Trav­el” for mac­in­tosh — allow us to view alter­nate ver­sions of our files over time.

First, we need to turn on the ser­vice.  For this you need to open your Con­trol Pan­el and Select “Sys­tem and Secu­ri­ty” then “Sys­tem” and from that (on the left) select “Sys­tem pro­tec­tion.”  On this pan­el, select your boot hard dri­ve (and you can then apply this to any oth­er hard dri­ves you’d like to also use this sys­tem) and click on the “Con­fig­ure” but­ton.  I have giv­en it about 10% of the avail­able space — which is a sen­si­ble set­ting.  See the image below (and feel free to click to see a larg­er version).

Shadow Copy Configuration Example

Shad­ow Copy Con­fig­u­ra­tion Example

You can cre­ate man­u­al snap­shots with the “Cre­ate” but­ton in this dia­log, but you’re not going to remem­ber to do this often enough (I cer­tain­ly don’t) and a back­up each time you install soft­ware isn’t very often, so we need to now cre­ate the auto­mat­ic por­tion of your backup.

Cre­ate a file in your home direc­to­ry or in a sub­di­rec­to­ry of your home direc­to­ry (I call my direc­to­ry scripts).  We’re going to write this in Visu­al Basic since a) I don’t know how to do it oth­er­wise; b) you can cre­ate the script with just notepad; and c) all Win­dows machines are already able to run Visu­al Basic scripts.  The file needs to end in “.vbs” to work.  I call mine “CreateRestorePointSilent.vbs” and you can cut-n-paste the fol­low­ing 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
	GetObject("winmgmts:\\.\root\default:Systemrestore").CreateRestorePoint "Scripted restore point", 0, 100
End If

Once you’ve saved this file, open the Con­trol Pan­el again, select “Sys­tem and Secu­ri­ty” again and from there select “Admin­is­tra­tive Tools”. On this pan­el, find and open “Task Sched­uler.” From there you will make sure that “Task Sched­uler Library” is select­ed and then select “Cre­ate a Basic Task” from the right-hand pan­el. NB: in this image, the cen­ter pan­el already indi­cates that have cre­at­ed a task called “Cre­ate Check­point” … your screen will not include this. This is also the place where your com­put­er records peri­od­ic actions it is per­form­ing — you might take a minute to look at the cen­ter list.

Create Backup Task Example: Step 1

Cre­ate Back­up Task Exam­ple: Step 1

Click next and you will be prompt­ed to select the trig­ger. You can choose “once a day” here or “when the com­put­er starts.” I’m choos­ing the lat­ter and we’ll return to this later.

Create Backup Task: Step 2

Cre­ate Back­up Task: Step 2

Click next again, select “Start a Pro­gram” and select your script.  The next step fin­ish­es this dia­log, but check the “open prop­er­ties” check­box or open the prop­er­ties of your new task.  The last step is to add anoth­er trig­ger to make it run a bit more often.  Select the trig­gers tab, select “New…” and cre­ate a “dai­ly” item for some­time when you are nor­mal­ly awake, but near the mid­dle or end of your day.  This will make a back­up for days when you do not shut­down your com­put­er.  Note that I have also checked the safe­ty fea­ture to kill the task if it runs longer than 30 minutes.

Create Backup Task: Step 3

Cre­ate Back­up Task: Step 3

Once you have done all this, you will be able to select “Show oth­er ver­sions” from the right-click menu of files.  If oth­er ver­sions of the file exist, you will be giv­en the oppor­tu­ni­ty to recov­er them.  You will also have the oppor­tu­ni­ty to “revert” the sys­tem to an ear­li­er back­up should a dri­ver instal­la­tion go badly.

Note that your files will revert as well if you con­sid­er doing this.

By that, I mean that revert­ing to a con­fig­u­ra­tion of the sys­tem that was made 10 min­utes ago dur­ing a failed install isn’t like­ly to loose too much of your work, but care should be tak­en if you’re con­sid­er­ing revert­ing to a ver­sion of the sys­tem that was made sev­er­al days ago.  You might want to back up your work to a USB key in that case.

As a pos­si­ble down­side, instal­la­tions (which cre­ate check­points) take some­what longer because I’m keep­ing dozens of check­points instead of one or two.  Anoth­er pos­si­ble caveat is that large media files that come and go on your hard dri­ve will have a detri­men­tal effect to the num­ber of shad­ow copy back­ups you can keep.  The sys­tem will keep as many back­ups as fit in the amount of disk you have select­ed it to use.  When the shad­ow copy sys­tem is seen to be using more space that allot­ted, it will delete back­ups until the space used by the back­ups is under set amount.

Anoth­er rel­e­vant caveat is that “defrag­ging” your hard dri­ve will dras­ti­cal­ly reduce the num­ber of shad­ow copies that are kept.  I don’t have a com­plete expla­na­tion oth­er than “This is what I have observed” and “This is what I have read.”  Some­thing along the lines of mov­ing the blocks for the defrag­ging can erase (acci­den­tal­ly or on pur­pose) the shad­ow copies.

Regard­less of these small caveats, this sys­tem has saved my butt a cou­ple of times recent­ly.  With 10% of the dri­ve allo­cat­ed an my usage of the machine, it tends to only have a few days to a week of data.  In my case I keep rough­ly 2 back­ups per day (in addi­tion to any that are cre­at­ed by installing or dein­stalling soft­ware).  More back­ups can use more space (although not always) and more back­ups can cre­ate (I believe) longer paus­es when installing software.

It is not a sub­sti­tute for reg­u­lar offline back­ups of impor­tant work prod­uct that you should already be doing, but it has a fine gran­u­lar­i­ty and a con­ve­nience of use (only a few min­utes to recov­er a file) make it an excel­lent addi­tion to any win­doze computer.

This entry was posted in Tech and tagged , , , , , . Bookmark the permalink.

7 Responses to Windows 7 Shadow Copy Backup Can be like Time Travel

  1. DaD says:

    So, is this like some­thing that “par­ents, do not try this at home”?

    • dgilbert says:

      Urm… well… I think you should be able to fol­low these direc­tions. I wrote them to be sim­ple and fair­ly com­plete. To get well ranked on Google, your answer needs to be help­ful to peo­ple. Keep in mind that this would be per­ma­nent­ly ded­i­cat­ing some per­cent­age of your disk space to this cause … but it should work fine for you. Your shad­ow copy might even be “on” … but only on for sys­tem files.

  2. Rebecca says:

    Don’t you only have XP on your laptop?

    • dgilbert says:

      No. I’ve had Win­dows 7/64 on my laptop(s) for some time at this point. I used to have both XP and 7/64 on my desk­top, but my XP instal­la­tion went sour.

  3. Rebecca says:

    No, I meant does­n’t Dad have XP on his laptop.

    • dgilbert says:

      Hrm. I don’t exact­ly recall. The arti­cle does talk about XP hav­ing caveats — but I don’t recall which win­doze Dad has.

  4. DaD says:

    I have XP Pro on both laptops

Leave a Reply

Your email address will not be published.

 characters available