Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Drive Display
#9
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
Reply


Messages In This Thread
Simple Drive Display - by eoredson - 12-10-2022, 04:43 AM
RE: Simple Drive Display - by Pete - 12-10-2022, 06:58 AM
RE: Simple Drive Display - by eoredson - 12-10-2022, 07:21 AM
RE: Simple Drive Display - by mnrvovrfc - 12-10-2022, 07:41 AM
RE: Simple Drive Display - by Pete - 12-10-2022, 07:57 AM
RE: Simple Drive Display - by Pete - 12-10-2022, 08:28 AM
RE: Simple Drive Display - by eoredson - 12-10-2022, 08:50 AM
RE: Simple Drive Display - by Pete - 12-10-2022, 08:58 AM
RE: Simple Drive Display - by eoredson - 12-10-2022, 09:06 AM
RE: Simple Drive Display - by mnrvovrfc - 12-10-2022, 09:16 AM
RE: Simple Drive Display - by Pete - 12-10-2022, 05:39 PM
RE: Simple Drive Display - by eoredson - 12-11-2022, 02:43 AM
RE: Simple Drive Display - by mnrvovrfc - 12-11-2022, 08:20 AM
RE: Simple Drive Display - by eoredson - 12-11-2022, 03:00 AM
RE: Simple Drive Display - by Pete - 12-11-2022, 03:45 AM
RE: Simple Drive Display - by eoredson - 12-11-2022, 05:30 AM
RE: Simple Drive Display - by eoredson - 12-12-2022, 05:38 AM
RE: Simple Drive Display - by Pete - 12-12-2022, 06:10 AM
RE: Simple Drive Display - by SMcNeill - 12-12-2022, 06:22 AM
RE: Simple Drive Display - by eoredson - 12-13-2022, 05:53 AM
RE: Simple Drive Display - by SpriggsySpriggs - 12-13-2022, 03:00 PM
RE: Simple Drive Display - by Pete - 12-13-2022, 03:22 PM
RE: Simple Drive Display - by SpriggsySpriggs - 12-13-2022, 04:21 PM
RE: Simple Drive Display - by Pete - 12-13-2022, 04:33 PM
RE: Simple Drive Display - by SpriggsySpriggs - 12-13-2022, 06:09 PM
RE: Simple Drive Display - by Pete - 12-13-2022, 07:05 PM
RE: Simple Drive Display - by vince - 12-13-2022, 10:25 PM
RE: Simple Drive Display - by Pete - 12-13-2022, 10:46 PM



Users browsing this thread: 4 Guest(s)