Backup locked files on Windows 10: Volume Shadow Copy Update

Demo of ShadowTask

The Volume Shadow Copy Service (VSS) can be used to mount a copy of a drive in a crash consistent state (like you just unplugged your computer) as a different drive letter. My shadow task command line tool makes it easy to do this. Here's an example:

ShadowTask64 C V test.bat

This creates a shadow copy of the C: drive, mounts it as V: and then runs test.bat. When test.bat completes the shadow V: drive is removed.

What can you do with this?

The simple case is grabbing a copy of a locked file. In this case test.bat could just run pause and then grab the file you need from V:.

It's also a great way to run a backup. In this case the batch file can run XCOPY (to a network share or portable drive) and you'll get all your files including anything locked like running executables or Outlook PST files.

Grab the latest from GitHub: abfo/shadow/releases. You'll find a ZIP file and source code if you want to use/extend this. There are 32 and 64-bit binaries - you need to use the right one for your computer and you also need to run the tool with administrative privileges. This only works with NTFS drives.


(All Code Posts)

Do useful things with the volume shadow copy service (VSS)

Updated on Thursday, November 12, 2015

The Volume Shadow Copy Service (VSS) takes a snapshot of an NTFS drive at a point in time. The clever thing about VSS is that it doesn't copy anything — it starts with the assumption that nothing has changed and then keeps track of every change to the snapshot so only changes need to be stored.

From Windows Vista on it's possible to mount a shadow copy as a drive letter or share. ShadowTask is a command line tool that creates a VSS copy, mounts it as a drive and then runs a program or batch file. For example:

ShadowTask C V dostuff.bat

Creates a copy of C:, mounts it as V: and then runs dostuff.bat.

Let's say you want to copy a locked file — maybe some outlook personal folders. Dostuff.bat could contain:

copy V:\Users\You\AppData\Local\Microsoft\Outlook.pst C:\Users\You\Desktop\OutlookBackup.pst

Bingo, you have a copy of your PST without shutting down Outlook.

Download: (50.86 kb)

The ZIP contains both 32 and 64 bit versions of the tool. You must use the version that matches your platform. ShadowTask supports Windows Vista and 7. XP doesn't support mounting a shadow copy so ShadowCopy will fail if you try to use it on XP. ShadowCopy must run as admin (elevated).

(All Code Posts)