DriveLetter
DriveLetter
返回本地驅動器或網路共享的驅動器號。只讀。
object.DriveLetter
object 應為 Drive 對象的名稱。
說明
以下代碼舉例說明如何使用 DriveLetter 屬性:
Sub ShowDriveLetter(drvPath)
Dim fs, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(drvPath))
s = "驅動器 " & d.DriveLetter & ": - "
s = s & d.VolumeName & vbCrLf
s = s & "可用空間: " & FormatNumber(d.FreeSpace/1024, 0)
s = s & "KB"
MsgBox s
End Sub