Click or drag to resize
IVssBackupComponentsAddToSnapshotSet Method (String, Guid)
The AddToSnapshotSet(String, Guid) method adds an original volume to the shadow copy set.

Namespace: Alphaleonis.Win32.Vss
Assembly: AlphaVSS.Common (in AlphaVSS.Common.dll) Version: (
Guid AddToSnapshotSet(
	string volumeName,
	Guid providerId


Type: SystemString
String containing the name of the volume to be shadow copied. The name must be in one of the following formats:
  • The path of a volume mount point with a backslash (\)
  • A drive letter with backslash (\), for example, D:\
  • A unique volume name of the form "\\?\Volume{GUID}\" (where GUID is the unique global identifier of the volume) with a backslash (\)
Type: SystemGuid
The provider to be used. Empty can be used, in which case the default provider will be used.

Return Value

Type: Guid
Identifier of the added shadow copy.
UnauthorizedAccessExceptionCaller 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.
VssBadStateExceptionThe backup components object is not initialized, this method has been called during a restore operation, or this method has not been called within the correct sequence.
VssMaximumNumberOfVolumesReachedExceptionThe maximum number of volumes has been added to the shadow copy set. The specified volume was not added to the shadow copy set.
VssMaximumNumberOfSnapshotsReachedExceptionThe volume has been added to the maximum number of shadow copy sets. The specified volume was not added to the shadow copy set.
VssObjectNotFoundExceptionvolumeName does not correspond to an existing volume.
VssProviderNotRegisteredExceptionproviderId does not correspond to a registered provider.
VssProviderVetoExceptionExpected provider error. The provider logged the error in the event log.
VssVolumeNotSupportedExceptionThe value of the providerId parameter is Empty and no VSS provider indicates that it supports the specified volume.
VssVolumeNotSupportedByProviderExceptionThe volume is not supported by the specified provider.
VssUnexpectedProviderErrorExceptionThe provider returned an unexpected error code.

The maximum number of shadow copies in a single shadow copy set is 64.

If providerId is Empty, the default provider is selected according to the following algorithm: If any hardware-based provider supports the given volume, it is selected.If there is no hardware-based provider available, if any software-based provider supports the given volume, it is selected.If there is no hardware-based provider or software-based provider available, the system provider is selected. (There is only one preinstalled system provider, which must support all nonremovable local volumes.)

See Also