PDA

Click to See Complete Forum and Search --> : Drives


HexMaster
Nov 18th, 1999, 12:47 AM
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

Aaron Young
Nov 18th, 1999, 01:12 AM
The Drive Control does this for you,
but if you want to do it yourself, try the GetLogicalDriveStrings API..

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
aarony@redwingsoftware.com
adyoung@win.bright.net