共用方式為


IVMVirtualServer::SearchPaths property

The SearchPaths property contains an array of file system paths which are used to find files associated with Virtual Server.

This property is read/write.

Syntax

HRESULT put_SearchPaths(
  [in]  VARIANT searchPaths
);

HRESULT get_SearchPaths(
  [out] VARIANT *searchPaths
);

VB
VMVirtualServer.SearchPaths( _
  ByRef searchPaths, _
  ByVal searchPaths _
)

Property value

Contains a safearray containing a file system path for each entry.

This property value is read/write.

Error codes

Name Meaning
S_OK
The operation was successful.
E_POINTER
The searchPaths parameter is NULL.
E_INVALIDARG
The searchPaths parameter is not valid and could not be parsed into an array of paths.
E_FILE_NOT_FOUND
The system cannot find a directory specified in the searchPaths parameter.
E_PATH_NOT_FOUND
The system cannot find a path specified by the searchPaths parameter.
E_INVALID_NAME
A path specified in the searchPaths parameter contains illegal characters. The illegal characters are "*?<>/|":"
E_BAD_PATHNAME
A path contained in the searchPaths parameter specifies an empty or relative path. An absolute path is required.
E_BUFFER_OVERFLOW
The path specified in the searchPaths parameter is too long. The length of the path must be less than 260 characters.
VM_E_PREF_NOT_FOUND
The preference was not found.
DISP_E_EXCEPTION
An unexpected error occurred.

Examples

The following example displays the SearchPaths property value of the VMVirtualServer object.

Set objVS = CreateObject("VirtualServer.Application")
Dim allPaths

Wscript.Echo "Name: " & objVS.Name

allPaths = objVS.SearchPaths

If UBound (allPaths) = -1 Then
  Wscript.Echo "File search paths: [empty]"
Else
  Wscript.Echo "File search paths: "
  For i = LBound(allPaths) to UBound(allPaths)
    wscript.echo allPaths(i)
  Next
End If

Requirements

Product
Microsoft Virtual Server 2005 onWindows Server 2003
Download
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003
Header
VsComInterfaces.h

See also

IVMVirtualServer