The brain-dead backup function under Vista is enormously annoying, but fortunately you can easily get the trusty old ntbackup program running. See this excellent article on the Petri IT knowledgebase for details.
However, this basic solution has two major limitations:
I think I've found a solution to the latter problem, and possibly the first one as well.
To enable volume shadowing you'll need a copy of the VShadow tool, which is part of the free Microsoft VSS (Volume Shadow Copy) SDK. You'll also need a copy of the little utility dosenv.exe, which comes as part of various SDKs, or which can be downloaded directly from various utility websites. I learned about both of these from another excellent site, the Antimail Blog.
The solution is to wrap ntbackup in a pair of command scripts. The first, master script first invokes the system restore utility so you can optionally write a system restore point to disk (in lieu of a proper system state option). It then just invokes Vshadow to create the shadow copies, writes a set of environment variables describing them to a temporary script, and passes control to an inner script. The shadows only persist while this inner script is running, and are then torn down:
REM Backup script to set volume shadow copy for
REM ntbackup under Vista
REM First Create a dedicated system restore point
REM The following creates the volume shadows, and
REM passes control to BackupScript2.cmd.
REM This exits when that does.
"C:\Program Files\Microsoft\VSSSDK72\Tools\VSSReports\vshadow.exe" -script=backupenv.cmd -exec=BackupScript2.cmd C: F:
The second script first runs the temporary script to set environment variables describing the shadows. It then uses dosdev to map these to drive letters, and then passes control to ntbackup. When the backup is complete it does a bit of tidying up, then exits:
REM Backup script to use volume shadow copy with
REM ntbackup under Vista
REM Called by BackupScript.cmd, which creates the
REM shadow copy
REM This creates the environment variables with the shadow details
REM Now Map the DOS drives
dosdev Y: %SHADOW_DEVICE_1%
dosdev Z: %SHADOW_DEVICE_2%
REM Run the backup(s)
REM Tidy up
dosdev -r -d Y: %SHADOW_DEVICE_1%
dosdev -r -d Z: %SHADOW_DEVICE_2%
You use the volume shadows by backing up the mapped drives, not the original ones - you still need to "disable" volume shadowing in the ntbackup user interface.
There are a couple of weaknesses with this, and I'd welcome any suggestions for improvement:
If you'd like to comment on this article, with ideas, examples, or just to praise it to the skies then I'd love to hear from you.
© Questa Computing Ltd. 2007
Page last updated 14 May, 2015 13:34