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.