Volume Shadow Copy: your way to copying locked files

And you thought it couldn’t be done: copying locked files, such as your .pst file from Outlook, while Outlook has a lock on it. Enter the Volume Shadow Copy Provider.

On Windows XP and Windows Server 2003 a new service is available for your comfort: the Volume Shadow Copy Service. The idea is that you can temporarily mount a volume that provides a shadow copy of another drive. This shadow copy doesn’t have the locks that might exist on files on the original volume.

There are several COM interfaces that you can use to leverage the functionality, such as IVSSAdmin. There is even a COM+ application MS Software Shadow Copy Provider. And to top it off there is an SDK available for download. The SDK includes a sample project for vshadow.exe. It is a command-line tool, that when combined with some smart DOS commands in a batch file, can copy a file that is locked.

I will try to get some COM Interop going to make this all available through the VSS.VSSCoordinator or VSSW.VSSoftwareProvider class. If you beat me to it, let me know. 😉

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s