DriveType – Determine the type of a drive

DriveType – Determine the type of a drive

Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" _    (ByVal lpRootPathName As String) As LongConst DRIVE_UNKNOWN = 0      ' type can't be determinedConst DRIVE_NO_ROOT_DIR = 1  ' wrong argumentConst DRIVE_REMOVABLE = 2Const DRIVE_FIXED = 3Const DRIVE_REMOTE = 4Const DRIVE_CDROM = 5Const DRIVE_RAMDISK = 6' Determine the type of a drive. If you pass a null string it returns' the type of the current drive'' Returns one of the DRIVE_* constants, and stores in the optional' DriveDescription argument a textual description of the resultFunction DriveType(ByVal DriveName As String, Optional DriveDescription As _    String) As Long    If Len(DriveName) = 0 Then        ' use NULL if a null string has been passed (default drive)        DriveName = vbNullString    Else        ' otherwise always provide a colon and backslash        DriveName = Left$(DriveName, 1) & ":"    End If        DriveType = GetDriveType(DriveName)    Select Case DriveType        Case DRIVE_UNKNOWN            DriveDescription = "(unknown)"        Case DRIVE_REMOVABLE            DriveDescription = "Removable Drive"        Case DRIVE_FIXED            DriveDescription = "Fixed Drive"        Case DRIVE_REMOTE            DriveDescription = "Remote Drive"        Case DRIVE_CDROM            DriveDescription = "CD-ROM"        Case DRIVE_RAMDISK            DriveDescription = "RAM Disk"        Case Else            ' this includes the DRIVE_NO_ROOT_DIR case            DriveDescription = ""    End SelectEnd Function

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of