PDA

Click to See Complete Forum and Search --> : Re: Local or Share???


Jan 6th, 2000, 05:41 AM
I was wondering if there is any way I can determine whether or not a drive (ie. C or D) is a local or network (or share)?

Thanx.

SK

Clunietp
Jan 6th, 2000, 10:43 AM
here is a piece of code I use in an API wrapper project I have:


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


Tom