Results 1 to 2 of 2

Thread: Drives

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 1999
    Posts
    23

    Post

    I need to know how to find the drives in the computer (network drives would be nice too but not important currently). Can someone please help me?

    Matt

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    The Drive Control does this for you,
    but if you want to do it yourself, try the GetLogicalDriveStrings API..
    Code:
    Private Declare Function GetLogicalDriveStrings Lib "kernel32" Alias "GetLogicalDriveStringsA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
    
    Private Sub Form_Load()
        Dim sString As String
        Dim aList As Variant
        sString = Space(255)
        sString = Left(sString, GetLogicalDriveStrings(255, sString))
        aList = Split(sString, Chr(0))
        For i = 0 To UBound(aList)
            List1.AddItem aList(i)
        Next
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

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