The shadow copy service provides snapshots of the file volumes but appends a time stamp in the path. This may cause the resulting path to be longer than the system can handle. In order to copy files from the shadow copy “previous versions”, you need to shorten the path name.
The SUBST command line tool can be used to substitute part of the path with a drive letter so that the eventual source path is shortened. To get the path of the shadow copy, right click the folder in shadow copy, go to properties and the full path with the time stamp will be shown in the properties dialog.
Combined with ROBOCOPY, you can write a batch file to recovery lost file quite quickly:
cd c:\users\admin\desktop SUBST A: /D SUBST B: /D SUBST A: S:\@GMT-2012.09.21-04.00.21\Data SUBST B: G:\Data ROBOCOPY A: B: /XO /S /E /LOG:robocopy_log.txt /FP /NS /NC SUBST A: /D SUBST B: /D echo Copy Completed.