Visual Basic Scripting Edition | 語言參考 |
Drives 屬性返回由本地機器上所有 Drive 對象組成的 Drives 集合。 object.Drives
object 應為 FileSystemObject 對象的名稱。 說明無論是否插入媒體,可移動媒體驅動器都顯示在 Drives 集合中。 您可以使用 For Each...Next 結構枚舉 Drives 集合的成員,如下例所示: Function ShowDriveList
Dim fso, d, dc, s, n
Set fso =CreateObject("Scripting.FileSystemObject")
Set dc =fso.Drives
For Each d in dc n ="" s =s & d.DriveLetter & " - " If d.DriveType =3 Then n =d.ShareName ElseIf d.IsReady Then n =d.VolumeName End If s =s & n & "<BR>" Next ShowDriveList =s End Function
請參閱Drives 集合 | Files 屬性 | SubFolders 屬性 應用于:FileSystemObject 對象 返回首頁 |