2

I'm using Volume Snapshot Services (VSS) to backup a drive. By default all files listed under HKLM\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToSnapshot are deleted from the snapshot by VSS.

How can I make VSS to keep those files? There is some software (for ex. Macrium Reflect) that is able to do that. Thank you.

Euro Micelli
  • 33,285
  • 8
  • 51
  • 70
Isso
  • 1,285
  • 11
  • 23

1 Answers1

1

On systems that have it (XP doesn't), the "Shadow copy optimization writer" is the one in charge of deleting unwanted files from the shadow copy after the snapshot is taken.

I would either try to explicitely disable this writer, or call SetContext() with the VSS_VOLSNAP_ATTR_NO_AUTORECOVERY flag (it should prevent any post-snapshot write operation). However MSDN says that this flag has drawbacks.

mbarthelemy
  • 12,465
  • 4
  • 41
  • 43
  • Unfortunately that flag disables all writers, which is not what I want. I only need to ignore FilesNotToSnapshot. Macrium apparently does that by adding only necessary backup components rather than using default backup component list – Isso Oct 17 '12 at 23:08
  • And only disabling the "shadow copy optimization writer" as I suggested? Maybe it's worth trying – mbarthelemy Oct 18 '12 at 07:46
  • Good idea, sorry I missed it. Do you by any chance know how to do it? – Isso Oct 18 '12 at 20:22
  • 1
    Probably using [DisableWriterClasses()](http://msdn.microsoft.com/en-us/library/windows/desktop/aa382657(v=vs.85).aspx) or DisableWriterInstances() – mbarthelemy Oct 19 '12 at 12:41
  • @Isso, So how was it? – Pacerier Feb 14 '17 at 15:28
  • It worked, thanks a lot @mbarthelemy and sorry I forgot to mark the answer. Will do in a sec – Isso Feb 15 '17 at 16:11