Advertisement
2_2002-2004 Coding Standards #124361

Drive Type Finder

This code will loop through all drives and determine what type it is(hard disk, floppy, CDROM, network, etc)

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Dim strDrive As String
Dim strMessage As String
Dim intCnt As Integer
For intCnt = 65 To 86
  strDrive = Chr(intCnt)
  Select Case GetDriveType(strDrive + ":\")
      Case DRIVE_REMOVABLE
        rtn = "Floppy Drive"
      Case DRIVE_FIXED
        rtn = "Hard Drive"
      Case DRIVE_REMOTE
        rtn = "Network Drive"
      Case DRIVE_CDROM
        rtn = "CD-ROM Drive"
      Case DRIVE_RAMDISK
        rtn = "RAM Disk"
      Case Else
        rtn = ""
  End Select
  If rtn <> "" Then
    strMessage = strMessage & vbCrLf & "Drive " & strDrive & " is type: " & rtn
  End If
Next intCnt
MsgBox (strMessage)
Original Comments (3)
Recovered from Wayback Machine