Results 1 to 2 of 2

Thread: Re: Local or Share???

  1. #1
    Guest

    Post

    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



  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    here is a piece of code I use in an API wrapper project I have:

    Code:
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width