Actually I was thinking more upon this:
Code: (Select All)
Declare Library
Function GetDriveType& (d$)
End Declare
' declare library variables.
Dim Shared DriveType As String
' call drive type
For z = 1 To 26
x = DRIVEEXISTS(z)
If x = 0 Then
Print Chr$(z + 64) + ": "; DriveType
End If
Next
End
' check drive exists.
' returns -1 if drive not detected.
Function DRIVEEXISTS (V)
VarX$ = Chr$(V + 64) + ":\" + Chr$(0)
VarX = GetDriveType(VarX$)
DriveType = ""
Select Case VarX
Case 0
DriveType = "[UNKNOWN]"
Case 1
DriveType = "[BADROOT]"
Case 2
DriveType = "[REMOVABLE]"
Case 3
DriveType = "[FIXED]"
Case 4
DriveType = "[REMOTE]"
Case 5
DriveType = "[CDROM]"
Case 6
DriveType = "[RAMDISK]"
End Select
If VarX > 1 Then
DRIVEEXISTS = 0
Else
DRIVEEXISTS = -1
End If
End Function