GetDrive Method

 

Description

 

Returns a Drive object corresponding to the drive in a specified path.

 

PowerBASIC Syntax

 

METHOD GetDrive ( _

BYVAL bstrDriveSpec AS STRING _

) AS IDrive

 

Arguments

 

bstrDriveSpec

BSTR. The bstrDriveSpec argument can be a drive letter (c), a drive letter with a colon appended (c:), a drive letter with a colon and path separator appended (c:\), or any network share specification (\\computer2\share1).

 

Return Value

 

IDispatch. Reference to a IDrive interface.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem

DIM pDrive AS IDrive

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Get a reference to a drive

pDrive = fso.GetDrive(UCODE$("C:"))

 

Valid XHTML 1.0 Transitional