Using Vista Previous Versions to Restore Files You Thought You'd Lost

I'm a big fan of being productive by not losing work. I don't care how optimized your system and development tools are; if you have to do work to get back to where you were at a half hour ago, you're going backwards. I've previously written about using TimeSnapper as screen recorder so I can retrace my steps to anything that's happened on my screen in the past month. TimeSnapper continues to be one of the first tools I install on a new system.

But there are some things that slip through the cracks. For instance, what happens if a file gets corrupted, or if I accidentally save some new modifications over an old file which was previously working? We've got the recycle bin for accidentally deleted files, but until now if a file was overwritten the original version was just gone.

That's when I turn to a sadly ignored but very cool feature in Windows Vista: Previous Versions (a.k.a. Shadow Copy). If you're running Vista Ultimate or Business editions, you've got Shadow Copy and can right click any file or folder to look for a previous version, as pictured below. Previous Versions is like an informal source control system for files you hadn't thought to back up.

Note: If you're running another version of Windows Vista that doesn't have Shadow Copy, don't lose heart - there are still ways to take advantage of this feature. We'll get to those in a bit.Vista Previous Versions

So if an important file like applicationHost.config is corrupted, the first thing I do is check for a previous version. In the above case, I had 11 backup copies of the folder in three months, so it's likely that I could find a good copy. I could either just restore (the file or the entire folder) or I wanted to be a little more sure of things I could open or copy the files in question and compare them with the current version. It's easy to just make a copy of the folder at a point in time and merge it with the current version using a merge tool (e.g WinMerge).

Not Just For Klutzes

I'm often using Previous Versions to recover files I didn't personally overwrite. For example:

  • My team was installing software on demo machines late at night before a conference when some application specific files got overwritten. We were looking at having to reinstall a lot of software, which would have taken an hour or more. I recommended that we check for a previous version of the folder. Sure enough, it was there, and we were back in business within two minutes.
  • I rely on Firefox's session restore pretty heavily. I've had my session store get corrupted a few times over the past year. Each time, I've been able to recover it by restoring the following file: "C:\Users\[Username]\AppData\Roaming\Mozilla\Firefox\Profiles\[random].default\sessionstore.js"
  • I make incorrect assumptions on what Visual Studio Team System will do with my files based on my background using Subversion. I think the basic problem is that I'll make changes to files outside of Visual Studio, so Team System doesn't know I've made changes and overwrites without prompting the next time I do a checkout. I think I've learned my lessons here, but there have been several times this past year that I've recovered overwritten changes by restoring a Previous Version
  • Occasionally I'll shift-delete a bunch of files (shift-delete destroys the files immediately, bypassing the recycle bin), then realize I needed the file for some reason. Yeah, that's a klutz move. Previous Versions works there, too.

Hey, this sounds like System Restore

You're right! Previous Versions is related to System Restore since Windows uses the Volume Shadow copy service to create backups used by both System Restore and Previous Versions. System Restore is used for operating system specific files, while Previous Versions is used for everything else. System Restore was actually included in Windows ME, but don't hold that against it. System Restore is a great way to save a good computer gone bad.

I was first shown this when my wife's cousin and his friends - a bunch of college kids - stayed at our house a few years ago. I'd thoroughly borked our family's Media Center 2004 computer and was anticipating weeks of late nights trying to find stable drivers, when I came home from work to find the spring break kids watching TV. When I asked how they'd fixed the computer, they gave me the same look I probably give my parents when they lose e-mail attachments and said, "We just restored to a few days ago." Uh, right, I was planning to do that... Truth is, I'd bought the line the hipsters were selling me and had ignored System Restore. But in this case, it was exactly the right answer - rather than spend a week trying to manually restore my system to the way it had been the day before, they spent 10 minutes restoring the files and made it in time for Wapner.

What's Not To Like?

I've had discussions with friends who continue to dismiss the Previous Versions feature, and recommend turning it off. I don't think any of the arguments make sense, especially when you've lost a file you need. Here's a brief rundown on the pro's and con's:

Volume Shadow Copy performance impact

It's minimal, because it usually only runs when your machine is idle. System upgrades or software installation can request a restore point be created, which could take a few seconds. Bottom line - I haven't seen any facts behind the urban legend that Previous Versions or System Restore actually affect system performance in a negative way. I know that, like Raymond Chen, when I find the occasional use for them, they save me days of work. That seems like a pretty solid bet.

Volume Shadow Copy uses up disk space

By default, Vista uses 15% of the drive or 30% of the free space (whichever is less). That might be an issue if disk space wasn't so cheap as to be essentially free. But even if you're stuck on a small drive, you can modify the space Windows uses for System Restore with a simple registry tweak.

It's only included in Vista Business and Vista Ultimate

That's a bit of a a setback. Vista's got way too many versions, and if yours isn't Business or Ultimate, you've got a lousy deal in the Volume Shadow Copy area. That's because Vista still ships with the Volume Shadow Copy service enabled, but without a user interface to access it. So it's filling up 15% of your drive with files you can't access, which is less than optimal.

But we're not going to let a roadblock like that stop us, are we? Those files are there, and we're totally going to get them.

Option One - Shadow Explorer

Shadow Explorer is a free program which provides a user interface to your Previous Version files. It's not pretty, but we want our file pretty bad so we'll let it slide.

Shadow Explorer

Option Two - Show the files in Explorer with two Console Commands

Probably the quickest solution is to use some command-line trickery to make the Volume Shadow copies show up in Explorer. Adi Oltean wrote a nice post on this a bit ago - I'll summarize the steps, but you should really read his post to understand what he's doing. While the actual commands may look a bit scary, it's actually incredibly easy. There are just three steps:

  1. From an elevated command prompt, run the following: vssadmin list shadows |more
  2. Find the shadow copy set with the creation date you want and copy the Shadow Copy Volume line from set, which should look like this: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy10
  3. Create a symbolic to the the above path, with the following command (substituting in the correct info): mklink /d c:\shadowcopy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy10\

Pay attention to that last line! You've got to get the /d switch (to create a directory link) and you need to get that trailing backslash. But, you should be able to do the above three steps in about a minute, at which point you can browse through the shadow copy via command-line or the Windows Explorer.

Shadow Copy Symlink

This all works because the files were always stored on your hard drive, they just weren't visible because they weren't associated with a drive letter. Creating a symbolic link takes care of that. When you're done, just delete the folder in Explorer and the link is destroyed.

Option Three - Upgrade to Vista Business or Ultimate

You can use Vista Anytime Upgrade to upgrade to a version of Vista which includes the Previous Versions user interface. Remember that Vista's been making these file snapshots since you installed it, it just hasn't provided you a user interface to get to them. Upgrading will take care of that, and if you've got the budget or really need the files, it might be worth the $159 to $199 (depending on your current version) to just get to Ultimate.

There are three ways to look at this:

  1. How thoughtful of Vista to make shadow copies for me in all versions of Vista, so if I upgrade I'll have a backup history!
  2. Data recovery is a lame feature to use as an upsell - it should have been in all versions.
  3. This is "data blackmail" since someone who's lost a file is kind of being extorted into upgrading to get the files back.

Take your pick. I think I wind up on the second one - the Previous Versions UI should be in all versions. But again, this argument is academic when you've lost a file and want it back.

Published Wednesday, May 21, 2008 2:23 AM by Jon Galloway
Filed under: , ,

Comments

# re: Using Vista Previous Versions to Restore Files You Thought You'd Lost

> Team System doesn't know I've made changes and overwrites without prompting the next time I do a checkout

Impossible; Team System clients never overwrite files that are marked writable. Do you have repro steps?

Visual Studio might be doing god knows what, I suppose, but writable files are sacrosanct.

Wednesday, May 21, 2008 8:04 AM by Jeff Atwood

# re: Using Vista Previous Versions to Restore Files You Thought You'd Lost

Thanks for the comprehensive and clearly written post -- good stuff to know

Wednesday, May 21, 2008 12:51 PM by Guy

# re: Using Vista Previous Versions to Restore Files You Thought You'd Lost

Restoring the Firefox session file (suggested by Jon on Twitter) through Previous Versions has definitely saved my bacon a couple of times when I inadvertently cleared it.

Wednesday, May 21, 2008 4:09 PM by kevindente

# Using Vista Previous Versions to Restore Files You Thought You'd Lost

You've been kicked (a good thing) - Trackback from DotNetKicks.com

Wednesday, May 21, 2008 6:55 PM by DotNetKicks.com

# re: Using Vista Previous Versions to Restore Files You Thought You'd Lost

OMG I love you I love you I love you!!!!!  You really saved my life on this one.  Thanks a million!

Wednesday, June 04, 2008 8:16 PM by Mary Kerrigan

# impact of software on computer system

Pingback from  impact of software on computer system

Wednesday, June 11, 2008 7:41 AM by impact of software on computer system

# file make pro

Pingback from  file make pro

Wednesday, June 11, 2008 3:16 PM by file make pro

# overwrite computer files

Pingback from  overwrite computer files

Thursday, June 12, 2008 11:09 AM by overwrite computer files

# vista cracks

Pingback from  vista cracks

Thursday, June 19, 2008 9:10 AM by vista cracks

# restore disk

Pingback from  restore disk

Thursday, June 19, 2008 10:36 AM by restore disk

# easy recovery mail

Pingback from  easy recovery mail

Thursday, June 19, 2008 1:20 PM by easy recovery mail

# volume shadow copy service not working vista

Pingback from  volume shadow copy service not working vista

Saturday, June 21, 2008 11:51 AM by volume shadow copy service not working vista

# tweak ui

Pingback from  tweak ui

Saturday, June 21, 2008 4:01 PM by tweak ui

# ways to recycle

Pingback from  ways to recycle

Saturday, June 21, 2008 11:19 PM by ways to recycle

# restore data deleted

Pingback from  restore data deleted

Sunday, June 22, 2008 3:36 AM by restore data deleted

# disk recovery mail

Pingback from  disk recovery mail

Sunday, June 22, 2008 4:03 AM by disk recovery mail

# program cracks

Pingback from  program cracks

Sunday, June 22, 2008 11:13 PM by program cracks

# make windows disk out of a recovery disk

Pingback from  make windows disk out of a recovery disk

Monday, June 23, 2008 12:54 AM by make windows disk out of a recovery disk

# windows in recycle bin

Pingback from  windows in recycle bin

Tuesday, June 24, 2008 3:45 AM by windows in recycle bin

# hard drive recovery software

Pingback from  hard drive recovery software

Wednesday, June 25, 2008 2:14 PM by hard drive recovery software

# shadows vista

Pingback from  shadows vista

Sunday, June 29, 2008 5:54 AM by shadows vista

# link directory open source

Pingback from  link directory open source

Sunday, June 29, 2008 11:49 PM by link directory open source

# recorder uses disk space

Pingback from  recorder uses disk space

Thursday, July 03, 2008 5:53 PM by recorder uses disk space

# find command visual basic

Pingback from  find command visual basic

Saturday, July 12, 2008 5:50 AM by find command visual basic

# free file recovery program windows

Pingback from  free file recovery program windows

Saturday, July 26, 2008 6:19 PM by free file recovery program windows

# windows vista ultimate academic

Pingback from  windows vista ultimate academic

Saturday, August 02, 2008 2:13 PM by windows vista ultimate academic

# Hardware IT Blog » Blog Archive » windows vista ultimate academic

Pingback from  Hardware IT Blog  » Blog Archive   » windows vista ultimate academic

# free scary sounds

Pingback from  free scary sounds

Sunday, August 03, 2008 8:21 PM by free scary sounds

# second hard drive installation

Pingback from  second hard drive installation

Monday, August 04, 2008 1:42 AM by second hard drive installation

Leave a Comment

(required) 
(required) 
(optional)
(required)