by Raghu (22 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 13th September 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Simple code to list all the drives in the Machine
API Declarations
'Use Reference : Microsoft Scripting Runtime
'Controls Used : ComboBox , Command Button, Form
Dim fs as Scripting.FileSystemObject
dim drv as drives,dr as drive
set fs = CreateObject("Scripting.FileSystemObject")
set drv = fs.Drives
for each dr in drv
Combo1.Additem dr.DriveLetter
next
End Sub