DriveLetter Property

 

Description

 

Returns the drive letter of a physical local drive or a network share. Read-only.

 

PowerBASIC Syntax

 

PROPERTY GET DriveLetter () AS STRING

 

Return Value

 

BSTR. The drive letter.

 

Remarks

 

The DriveLetter property returns a zero-length string ("") if the specified drive is not associated with a drive letter, for example, a network share that has not been mapped to a drive letter.

 

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 the IDrive interface

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

' Get and display the drive letter

STDOUT "Drive: " & ACODE$(pDrive.DriveLetter)

 

Valid XHTML 1.0 Transitional