Click or drag to resize

IVssBackupComponentsDeleteSnapshotSet Method

The DeleteSnapshotSet method deletes a shadow copy set including any shadow copies in that set.

Namespace:  Alphaleonis.Win32.Vss
Assembly:  AlphaVSS.Common (in AlphaVSS.Common.dll) Version: (
int DeleteSnapshotSet(
	Guid snapshotSetId,
	bool forceDelete


Type: SystemGuid
Identifier of the shadow copy set to be deleted.
Type: SystemBoolean
If the value of this parameter is , the provider will do everything possible to delete the shadow copies in a shadow copy set. If it is , no additional effort will be made.

Return Value

Type: Int32
The total number of snapshots that were deleted
VssDeleteSnapshotsFailedExceptionThe deletion failed. This is the only exception actually thrown by this method. It wraps one of the other exceptions listed in this section as its inner exception.
UnauthorizedAccessExceptionThe caller does not have sufficient backup privileges or is not an administrator.
ArgumentExceptionOne of the parameters is not valid.
OutOfMemoryExceptionOut of memory or other system resources.
SystemExceptionUnexpected VSS system error. The error code is logged in the event log.
VssObjectNotFoundExceptionThe specified shadow copy does not exist.
VssProviderVetoExceptionExpected provider error. The provider logged the error in the event log.
VssUnexpectedProviderErrorExceptionUnexpected provider error. The error code is logged in the error log.

Multiple shadow copies in a shadow copy set are deleted sequentially. If an error occurs during one of these individual deletions, DeleteSnapshotSet will throw an exception immediately; no attempt will be made to delete any remaining shadow copies. The identifier of the undeleted shadow copy can be found in the instance of VssDeleteSnapshotsFailedException thrown.

The requester is responsible for serializing the delete shadow copy operation.

During a backup, shadow copies are automatically released as soon as the IVssBackupComponents instance is disposed. In this case, it is not necessary to explicitly delete shadow copies.

See Also