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.
Unfortunately there in no application that can give you the advantage of shadow copies if you are using a script for backing up your data, or if you are a system administrator who likes handy tools such as rdiff-backup or robocopy. In fact, Windows' NTBackup is known to universally s**k and VSHADOW.EXE (a tool bundled with the Microsoft SDK) is quite painful. I believe it was created as such on purpose.
Here's where VSCSC can help you, since it's nothing but a modified version of VSHADOW.EXE that features a -exec option which is much nicer than the original. This is what you need to know in order to use VSCSC:
This is the primary usage I had in mind.
vscsc -exec=script.bat C:
If everything works as expected, this is what should happen:
script.bat
is invoked with parameter "\\?\Volume{e64b105d-6e2a-11dd-b24a-00505695292c}" or whatever was the
weird name before. At this point script.bat
can access the snapshot which is immutable and can be read with no problem at all.
@echo off
DOSDEV B: %1
rem At this point B: is an immutable snapshot of C:, and you can copy from it.
rem You just need to write some stuff that actually copies data from B:
rem My favourite is rdiff-backup, but only robocopy can operate in backup mode
rem as a member of the Backup Operators group (/B switch), therefore bypassing
rem file permissions and security. This might be required sometimes.
DOSDEV /D B:
VSCSC retains most capabilities of VSHADOW.EXE. You can:
list (query) snapshots with -qvscsc -q
delete all snapshots with -davscsc -da
pause VSCSC just after snapshot creation with -wait vscsc -wait C:
The snapshot will remain valid until RETURN is pressed!
...
Open the project page at SourceForge.net.
You can view and download program sources from here, ask for help, and so on.
Microsoft Visual Studio 2008 is needed to compile from sources.
Sample scripts
Useful stuff. The following are repacks of some utilities that I use daily in my job and at home as ideal companions to SVCVC.
Each package contains separate versions for each of the supported platforms (currently Windows XP and Windows Server 2003 32 bit).