Sub ShowDriveType()
Set fso = CreateObject("Scripting.FileSystemObject")
drTypeAll = ""
For Each drv In fso.Drives
Select Case drv.DriveType
Case 0: drType = "Unknown"
Case 1: drType = "Removable"
Case 2: drType = "Fixed"
Case 3: drType = "Network"
Case 4: drType = "CD-ROM"
Case 5: drType = "RAM Disk"
End Select
If drv.IsReady Then
drTypeAll = drTypeAll + drv.DriveLetter + " Type:" + drType + " SR:" + CStr(drv.SerialNumber)
Else
drTypeAll = drTypeAll + drv.DriveLetter + " Type:" + drType + " SR:" + "未准備好"
End If
drTypeAll = drTypeAll + vbCrLf
Next
MsgBox drTypeAll
End Sub