用API试试
Function long GetDriveTypeA(string nDrive)Library "kernel32"
循环A到Z驱动器
ll_drive=GetDriveTypeA("A")
CHOOSE CASE ll_drive
CASE 2
drvinfo='可移动驱动器'
CASE 3
drvinfo='固定驱动器'
CASE 4
drvinfo='网络驱动器'
CASE 5
drvinfo='CD-ROM驱动器'
CASE ELSE
drvinfo='不是驱动器'
END select
Sub ShowDriveType(drvpath)
Dim fs, d, s, t
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(drvpath)
Select Case d.DriveType
Case 0: t = "未知"
Case 1: t = "可移动驱动器"
Case 2: t = "固定驱动器"
Case 3: t = "网络驱动器"
Case 4: t = "CD-ROM"
Case 5: t = "RAM 驱动器"
End Select
s = "Drive " & d.DriveLetter & ": - " & t
MsgBox s
End Sub