The usage of VBS object Drives
This article focuses on "the use of VBS object Drives". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the usage of VBS object Drives.
Read only the collection of all available drives.
Description
Removable media drives are displayed in the Drives collection regardless of whether media is inserted or not.
The following code illustrates how to get the Drives collection and enumerate the collection members using the For Each...Next statement:
ShowDriveList functions 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 = Remote Then n = d.ShareName ElseIf d.IsReady Then n = d.VolumeName End If s = s & n & "
"Next ShowDriveList = sEnd Function so far, I believe you have a deeper understanding of the use of" VBS object Drives ", might as well come to the actual operation of it! here is the website, more related content can enter the relevant channels to query, follow us, continue to learn!