3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Neji
5

yes, here it is the code, try it and let me know if it worked :

Dim AllDir
Private Sub Form_Load()
On Error Resume Next
For i = 65 To 90
x = Dir(Chr(i) & ":\", vbDirectory + vbHidden + vbSystem)

If Err = 52 Then
    Err.Clear
Else
    If x <> "" Then AllDir = AllDir & (Chr(i) & ":\")
      Err.Clear
End If

Next i
MsgBox AllDir
End Sub

Hope this helps...

Votes + Comments
spontan uhuy
worked
thank you very much. it was i looking for
0

Hi,

One more Simple way:

Add a DriveListBox on the form and loop thru all the list items.. it lists all the drives

Regards
Veena

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.