Volume Shadow Toolkit (VsToolkit)

The Volume Shadow Copy Service is a service introduced in Windows NT and developed in every following Microsoft Operating System up to Windows 7 and beyond. It is based on snapshot capabilities provided by the NTFS file system, which allows copying files while they are in use (even locked by an application writing them). In short, if a file is being modified, a consistent copy of the old version (actually a copy of the blocks of that file which are being modified) is kept and new data are written to an alternate location, therefore preserving the former state of the volume as long as the snapshot exists. Support for this feature varies a lot depending on which Windows is in use: e.g. Windows 2003 supports persistent snapshots while Windows XP only supports temporary snapshots.

VsToolkit will give you the advantage of shadow copies for backing up your data using Personal Backup (or any other suitable backup software). It is a modified version of VSHADOW.EXE bundled with the Microsoft SDK 7 based on the C++ program VSCSC.EXE (Volume Shadow Copy Simple Client). The program is featuring a -exec option to start any program or batch script with the temporary virtual drive generated by the VSS system as command line parameter:

Important notes

Using VsToolkit together with a batch script

This is the primary usage of the program
VsToolkit -exec=script.bat C:
If everything works as expected, this is what should happen:

  1. A new snapshot is created for volume C: which corresponds to a volume such as
    "\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1"
  2. The script named script.bat is invoked with this volume name as parameter. At this point script.bat can access the snapshot which is immutable and can be read with no problem at all.
  3. When script.bat terminates, the snapshot gets deleted and so is the volume with the above name.
  4. The script itself can start any backup program, e.g. Personal Backup.

Using VsToolkit manually

VsToolkit retains many options of VSHADOW.EXE:

And has one new option:

Invoke VsToolkit with no parameters to see all the available options.

Links


J. Rathlev, D-24222 Schwentinental, Dec. 2017