Click or drag to resize

IVssBackupComponentsAddNewTarget Method

The AddNewTarget method is used by a requester during a restore operation to indicate that the backup application plans to restore files to a new location.

Namespace:  Alphaleonis.Win32.Vss
Assembly:  AlphaVSS.Common (in AlphaVSS.Common.dll) Version: 1.4.0.0 (1.4.0.0)
Syntax
void AddNewTarget(
	Guid writerId,
	VssComponentType componentType,
	string logicalPath,
	string componentName,
	string path,
	string fileName,
	bool recursive,
	string alternatePath
)

Parameters

writerId
Type: SystemGuid
Globally unique identifier (GUID) of the writer class containing the files that are to receive a new target.
componentType
Type: Alphaleonis.Win32.VssVssComponentType
Identifies the type of the component, see the documentation for VssComponentType for more information.
logicalPath
Type: SystemString

String containing the logical path of the component containing the files that are to receive a new restore target.

The value of the string containing the logical path used here should be the same as was used when the component was added to the backup set using AddComponent(Guid, Guid, VssComponentType, String, String).

The logical path can be .

There are no restrictions on the characters that can appear in a non-null logical path.

componentName
Type: SystemString

The name of the component containing the files that are to receive a new restore target.

The string should not be and should contain the same component name as was used when the component was added to the backup set using AddComponent(Guid, Guid, VssComponentType, String, String).

There are no restrictions on the characters that can appear in a non-NULL logical path.

path
Type: SystemString

The name of the directory or directory hierarchy containing the files to receive a new restore target.

The path can contain environment variables (for example, %SystemRoot%) but cannot contain wildcard characters.

There is no requirement that the path end with a backslash ("\"). It is up to applications that retrieve this information to check.

fileName
Type: SystemString

The file specification of the files to receive a new restore target.

A file specification cannot contain directory specifications (for example, no backslashes) but can contain the ? and * wildcard characters.

recursive
Type: SystemBoolean
Boolean indicating whether only the files in the directory defined by path and matching the file specification provided by fileName are to receive a new restore target, or if all files in the hierarchy defined by pathand matching the file specification provided by fileName are to receive a new restore target.
alternatePath
Type: SystemString
The fully qualified path of the new restore target directory.
Exceptions
ExceptionCondition
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.
VssObjectNotFoundExceptionThe component does not exist or the path and file specification do not match a component and file specification in the component.
VssInvalidXmlDocumentExceptionThe XML document is not valid. Check the event log for details.
NotSupportedExceptionThe operation is not supported on the current operating system.
Remarks
Note Note
This method is not supported on Windows XP
See Also