Drive Info is need for getting drive properties. In this case, we used its name.
Originally Posted by mo3ad001
Just check whether the current drive is "C:" :
Code:
For Each drive As DriveInfo In My.Computer.FileSystem.Drives
If drive.Name.startswith("C") Then
For Each N As String In My.Computer.FileSystem.GetDirectories(drive.Name)
Try
For Each x As String In My.Computer.FileSystem.GetFiles(N, FileIO.SearchOption.SearchAllSubDirectories, "*.*")
Application.DoEvents()
ListBox1.Items.Add(x)
Next
Catch ex As Exception
Continue For
End Try
End If
Next
Next

but have some lag 