Option Explicit
On Error Resume Next
Const DriveType = 3
Dim colDrives
Dim drive
set colDrives = _
GetObject("winmgmts:").ExecQuery _
("select DeviceID from Win32_LogicalDisk where DriveType =" & DriveType)
For Each drive in colDrives
WScript.Echo drive.DeviceID
Next