here is a piece of code I use in an API wrapper project I have:
TomCode:Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" _ (ByVal nDrive As String) As Long Public Enum DriveTypes DRIVE_RAMDISK = 6 DRIVE_CDROM = 5 DRIVE_NETWORK = 4 DRIVE_FIXED = 3 DRIVE_REMOVABLE = 2 DRIVE_NO_EXIST = 1 DRIVE_UNKNOWN = 0 End Enum Public Function GetVolumeType(ByVal RootPath As String) As DriveTypes If Right(RootPath, 1) = ":" Then RootPath = RootPath & "\" GetVolumeType = GetDriveType(RootPath) End Function




Reply With Quote