A. You can use diskshadow.exe, a new utility in Windows Server 2008, to create shadow copies and restore content from a shadow copy. Diskshadow.exe can create VSS snapshots, mount snapshots with a volume letter, and delete snapshots. The following script, written in the Diskshadow utility’s scripting syntax, creates a snapshot of the D drive, mounts the snapshot as drive X, calls a command file to copy files from X to a backup location, then unmounts the snapshot and deletes it.

#vmbackups.dsh<br><br>#Make shadows persistent<br>SET CONTEXT PERSISTENT<br>SET VERBOSE ON<br><br>#Cab location for process<br>SET METADATA d:\temp\Backup.cab <br><br><br>BEGIN BACKUP <br><br>#Alias volume with alias <br>ADD VOLUME D: ALIAS DVOL<br><br>#Create Snapshot<br>CREATE <br><br>#Expose the volume and run command file then unexpose<br>EXPOSE %DVOL% X:<br>EXEC D:\Scripts\copycommands.cmd<br>UNEXPOSE X:<br><br>END BACKUP<br><br>#Delete the shadow copy<br>DELETE SHADOWS SET %VSS_SHADOW_SET%

The command file copycommands.cmd can contain any commands you need for copying your desired files from the shadow copy.

Save the script as vmbackups.dsh and run it using the command

diskshadow -s vmbackups.dsh

For more about Diskshadow scripts, see Microsoft’s page on the Diskshadow utility.