2

On server operating systems I can (and do) create a shadow copy of a volume and mount that copy using mklink before copying a folder that almost always has open files. See below for Q&D example.

FOR /f "tokens=1,2 delims=:" %%a in ('vssadmin create shadow  /for^=d: /autoretry^=3 ^| find "Shadow Copy Volume Name"') do set ShadowPath=%%b\
MKLINK /d c:\ShadowPath\ %ShadowPath%
ROBOCOPY c:\shadowpath\Accounts \\NAS2\OffsiteBackup\%ComputerName%\D\Accounts /mir 
RD c:\ShadowPath\

I would like to do a similar thing on a Windows 7 machine and of course "vssadmin create shadow" is not supported. I have used vshadow/vscsc and related utilities (dosdev etc) in the past however it would be nice to not use any third party utilities.

Using wbadmin to start and then stop a backup does create a SRP but is clumsy.

"wmic shadowcopy create" seems like it might work but I cannot work out the syntax.

Any input that will point me in the right direction will be much appreciated.

2
  • What edition of Windows 7/8? Mar 16, 2015 at 2:18
  • I want to do this on Windows 7 Pro SP2, fully patched.
    – Chris
    Mar 17, 2015 at 22:06

1 Answer 1

0

you can use a VBS und start the VBS from a batch. VBS Scripts for Shadow Copy: http://www.activexperts.com/network-monitor/windowsmanagement/scripts/shadowcopy/

batch.cmd: cscript "CreateShadowCopy.vbs"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .