DiskDriveType

Returns drive type as text, like fixed, CD, etc.
Can pass either drive letter, or the output of Drive.DriveType of FSO object

CodeFunctionName
What is this?

Public

Tested

Original Work
Function DiskDriveType(drvpath, Or_DriveTypeNumber)
    ' returns text represent drive type
    ' needs either drive letter
    ' or the output of DriveType call
    If drvpath = "" Then
        NewDriveTypeID = Or_DriveTypeNumber
    Else
        Dim fs, d
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set d = fs.GetDrive(drvpath)
        NewDriveTypeID = d.DriveType
        Set d = Nothing
        Set fs = Nothing
    End If
    Rett = ""
    Select Case NewDriveTypeID
        Case 0: Rett = "Unknown"
        Case 1: Rett = "Removable"
        Case 2: Rett = "Fixed"
        Case 3: Rett = "Network"
        Case 4: Rett = "CD-ROM"
        Case 5: Rett = "RAM Disk"
    End Select
'    s = "Drive " & d.DriveLetter & ": - " & t
    DiskDriveType = Rett
End Function

drvpath, Or_DriveTypeNumber

Views 85

Downloads 36

CodeID
DB ID