Copy Locked/In Use Files in Windows Vista
Posted by Kevin Purdy at 12:00 AM on March 11, 2008
Windows Vista has a habit of making files unavailable for backup programs or just copying into new locations, claiming files you haven't touched are "In use," or sometimes just generically "Locked." The How-To Geek shows us a command-line utility, Hobocopy, that can find its way past the walls thrown up by the operating system's shadowy functions. You'll also learn how you can use Hobocopy as an incremental backup solution, like a less syntax-heavy version of cross-platform solution rsync. Hit the link to find Hobocopy and get step-by-step instructions.
Tags: backup | command line | copy and paste | how to | utilities | windows | windows vista | windows vista tip

Comments (AU Comments · US Comments)
There are currently no AU comments for this post.
tap52384
Posted 12:54 AM 11/3/08
Unlocker 1.8.6 unlocks files that are in use; perhaps running this on a folder or drive would have the same effect?
tap52384
The How-To Geek
Posted 1:33 AM 11/3/08
Unlocker works by closing the applications that are accessing a file...
HoboCopy taps into the shadow copy features in Windows and makes a "snapshot" of the file as of a certain point in time. Then it copies that snapshot to the new location... all without requiring you to close anything. It's the same API that backup programs tap into.
Oh, and it should work on XP / win2k3 as well.
The How-To Geek
SEMW
Posted 2:53 AM 11/3/08
@ The How-To Geek: >Oh, and it should work on XP / win2k3 as well.
2k3, yes; XP, no. XP didn't have shadow copy (expect possibly XP Pro x64 edition, which was based on Win2k3).
SEMW
The How-To Geek
Posted 3:34 AM 11/3/08
@SEMW:
Actually it was introduced in XP service pack 1 (32-bit)
[en.wikipedia.org]
The How-To Geek
lemur
Posted 4:16 AM 11/3/08
The question I have is how does HoboCopy know that a file to be copied is in a consistent state? If HoboCopy cannot make sure that the file is consistent, then that's playing Russian roulette: sometimes the data copied is good, sometimes it is bad.
lemur
The How-To Geek
Posted 5:02 AM 11/3/08
Shadow copy is going to give you the version as of the time of the snapshot, which means the time of the last write to disk before Hobocopy creates a temporary snapshot.
To test this out, you can create a new PST in outlook, then verify that the file is locked by trying to copy through explorer. Add some folders, emails, etc to that PST file and then use HoboCopy to make a copy of the PST. Open the copy of the PST, and you'll see all the mail sitting in it.
Shadow copy is the underlying API for NTBackup and all backup utilities on Windows.
The How-To Geek
bobbo33
Posted 5:02 AM 11/3/08
@The How-To Geek: @SEMW: Gentlemen, in a sense you are both right, but you must be more specific with your terms.
XP only implemented Volume Shadow Copy (VSS), which only captured periodic changes to a drive's entire volume - thus users could not easily restore individual files.
With 2K3 and (certain versions of) Vista, Shadow Copy was implemented on a file level, so that Previous Versions of individual files could be restored.
Microsoft was thoughtful enough to use the term "Shadow Copy" interchangeably between the XP/2K3/Vista versions, despite the differences.
So as it applies to hobocopy, SEMW is more right this time. I downloaded and ran it on my XP-Pro-SP2, and it works fine.
BTW, make sure you get the right version. Refer to the project's homepage and sf.net download page: there are separate downloads for XP and 2K3/Vista, plus a runtime you might need.
bobbo33
rpresser
Posted 5:02 AM 11/3/08
Shadow copy works by giving you the version of the file that was extant BEFORE the currently locking application opened it. If the file was consistent before you started using it, you'll get that copy.
I believe it does this by making use of the journaling features in NTFS.
Now, as for hobocopy being as good as rsync: It's not. The rsync protocol uses a delta algorithm -- even on binary files -- to copy the minimum number of blocks necessary to patch an old backup to be equivalent to the new file. hobocopy is going to copy the entire file. If you have a 15 gigabyte PST (Outlok Personal Folder file) that you want to back up to a network share, Hobocopy is going to copy it ALL over the wire. Rsync might get away with only a few megabytes -- and the result will be a perfect backup.
Rsync won't use shadow copy, though, at least not in current releases.
rpresser
gycafesor
Posted 3:53 AM 12/3/08
Can I use Daniusoft DVD Copy copy locked files in Windows Vista?
gycafesor