problem alphavss wrapper

  • Thread starter Thread starter SajjadKhati
  • Start date Start date
S

SajjadKhati

Guest
hi guys .

i intend to get vss (volume shadow copy services) backup from a drive by "alphavss" wrapper in c# as my backup be displayed in previous version tab of it's drive (properties > previous version) .

i write below code :


IVssImplementation vssImplementation = VssUtils.LoadImplementation();
using (IVssBackupComponents vssBackup = vssImplementation.CreateVssBackupComponents())
{
vssBackup.InitializeForBackup(null);

vssBackup.GatherWriterMetadata();
vssBackup.SetContext(VssSnapshotContext.Backup);
vssBackup.SetBackupState(false, false, VssBackupType.Full, false);
Guid MyGuid_1 = vssBackup.StartSnapshotSet();
Guid MyGuid_2 = vssBackup.AddToSnapshotSet("F:\\");
vssBackup.PrepareForBackup();
vssBackup.DoSnapshotSet();

}



this code provide vss backup .

but gotten backup don't appear in previous version tab .

i changed attributes in "SetContext" method :


vssBackup.SetContext(VssVolumeSnapshotAttributes.Persistent | VssVolumeSnapshotAttributes.ClientAccessible | VssVolumeSnapshotAttributes.NoAutoRelease | VssVolumeSnapshotAttributes.Differential | VssVolumeSnapshotAttributes.AutoRecover);

vssBackup.SetBackupState(false, false, VssBackupType.Full, false);


but i get this error :

"Alphaleonis.Win32.Vss.VssUnsupportedContextException: 'The operation is not supported under the current context."


how to i change this code to my backup be displayed in previous version tab of it's drive?

thanks

Continue reading...
 
Back
Top