Get the App
SLTechnology News&Howtos  ›  Development  › 

The usage of VBS object Drives

Shulou Source: shulou.com Published: 2022-06-03 19:41:32 09月14日 Update

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!

Tags: Objects content media drivers learning drivers practical deeper code interests functions practicality practical members easy to operate methods more friends websites statements Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Xiaomi Apple vpn NVidia