setlocal if NOT "%CALLBACK_SCRIPT%"=="" goto :IS_CALLBACK set CALLBACK_SCRIPT=%~dpnx0 vshadow.exe -nw -script=vss-setvar.cmd -exec=%CALLBACK_SCRIPT% C: @goto :EOF :IS_CALLBACK setlocal set CALLBACK_SCRIPT= call vss-setvar.cmd dosdev B: %SHADOW_DEVICE_1% robocopy B:\ L:\DRIVEC\ /mir /b /sec /XJ /np /ndl /xd "System Volume Information" /xf hiberfil.sys pagefile.sys /log:backup.log dosdev -r -d B: pause On the first pass of the CMD file, we set CALLBACK_SCRIPT equal to the name of the running script. Much of the magic takes place with the vshadow command. This creates a shadow volume of the specified drive (C:). I set the no writers flag since we're not going to need to write to it. vshadow will also write out another CMD file that contains a handle to the shadow copy. And finally it calls this script a second time. Obtaining a clean copy of vshadow was a hassle. I had to download/install the entire Windows SDK (several GB) just to get a 300K executable. I'm sure you can find copies of that file but they may be infected with malware. Once vshadow has done its thing, it calls this script again. This time, CALLBACK_SCRIPT is set and it jumps to the label :IS_CALLBACK. Now we call the CMD file created by vshadow (vss-setvar.cmd) to get that handle to the shadow copy into environment variables. Next we call dosdev.exe which maps the shadow volume to our B: drive. So now we have a complete shadow copy of C: available at B: with no open/locked file issues. You will need to Google for a copy of dosdev.exe. Next we invoke robocopy and use the /mir (mirror) option to copy the C: drive to L:\DRIVEC\. We exclude System Volume Information, hiberfil.sys and pagefile.sys. The /XJ switch does seem to be necessary to avoid some file system recursion. Robocopy ships with Windows 7 as standard. When the copy is copy is complete, we release the assignment of the shadow to the B: drive.