Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While improving my (personal) backup system, I noticed, that I cannot copy certain locked files, like the windows registry files. Is there a way to copy such things? Or a specific solution for the registry (I know of the regedit->File->Export ,,solution'' but this is to text format and seems slow). AFAIK, on Linux the locking system is advisory and on Windows it is mandatory. Can I somehow bypass the mandatory-ness for backup purposes etc.? TIA.

share|improve this question
I use Java and can write additional code in C,C++,C# if necessary. Oh, and having written that, this question also qualifies for stackoverflow, hmmm. – karolrvn Apr 10 '10 at 13:43
Also do You know, how commercial backup programs handle this (if at all)? I am gonna test Acronis ,,Backup and Recovery'' app soon. – karolrvn Apr 10 '10 at 14:58
up vote 0 down vote accepted

From Wikipedia:

Shadow Copy (Volume Snapshot Service or Volume Shadow copy Service or VSS ), is a technology included in Microsoft Windows that allows taking manual or automatic backup copies or snapshots of data, even if it has a lock...

share|improve this answer
...and VSS is a bit tricky to drive programmatically... – Roger Lipscombe Apr 10 '10 at 16:05
Thanks for a lead. – karolrvn Apr 10 '10 at 17:05
How hard to drive programmatically? – karolrvn Apr 10 '10 at 19:28

I wrote some scripts a while ago to do exactly this. They use volume shadow copy to create a temporary snapshot, then copy the files from the snapshot before releasing it.

And I used Robocopy to do the copying, so if the file already exists in the target folder and hasn't changed then it is skipped.

It works extremely well, when run every day it only took about 2 minutes to "freshen" a backup of the system volume of a win2003 server. With a small amount of stuffing around you can get the backup of an XP or a win2003 system volume to boot. (Details on how to do this are in a text file in the linked archive.)

I never tried to get a backup of a 7/vista/2008 system volume to boot, but I'm sure that would be possible too.

You can download the script and related tools from here:

Let me know if you find them useful!

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .