My site is ad supported.

Mount Latest Shadow Copy (Script)

Version 1.0 - Download


Description

Provides a simple front end interface to the VSSAdmin command line tool for automatically locating and mounting the latest shadow copy for a drive. Once complete, the specified directory can be used to backup or copy locked files via popular tools such as XCopy or Robocopy.

A detailed description is available at my article featured on How-To Geek: HTG Explains: What are Shadow Copies and How Can I Use Them to Copy or Backup Locked Files?

Note: Usage of this tool requires the script to be run with elevated privledges. The command prompt must be launched using "Run as administrator" and scheduled tasks must have the "Run with highest privledges" box checked. This is due to the elevated rights the VSSAdmin tool requires.

Examples

Mount the latest shadow copy of drive C to the folder "C:\LatestShadow":

MountLatestShadowCopy C:\LatestShadow\ C:

The following script mounts the latest shadow copy of drive C to the directory "C:\MyShadow" and then copies the "outlook.pst" located in the current user's Documents folder to a backup server. Once finished, the directory which held the shadow copy location is removed to clean itself up:

CALL MountLatestShadowCopy C:\MyShadow\
 
XCOPY "C:\MyShadow\Users\%UserName%\Documents\Outlook\outlook.pst" "\\BackupServer\MyFiles\"
 
RMDIR C:\MyShadow


My site is ad supported.

Help Information (/?)

MountLatestShadowCopy MountToFolder [SearchDrive]

 MountToFolder  Folder location where the shadow copy contents will be made
                available. This folder should NOT exist; it will be created
                as a mount point and accessible after the operation completes.
                Important Note: The target specified should end with
                a \ character to ensure it is properly read as a directory.
                For example: C:\MyShadowCopy\
 SearchDrive    Specifies the local drive for which you want to mount the
                latest shadow copy. Enter with a colon following the drive
                letter. Default value is C:.

Note: This script MUST be run as Administrator (with highest privledges in a
      scheduled task) in order to work properly.

Requirements:
 Windows Vista or later with System Restore enabled.