ListBox2.Items.Clear()
Dim myCoolFolder As String = "F:\"
Try
For Each myCoolFile As String In My.Computer.FileSystem.GetDirectories _
(myCoolFolder, FileIO.SearchOption.SearchAllSubDirectories, "*.*")
ListBox2.Items.Add(myCoolFile)
Next
Catch ex As UnauthorizedAccessException
MsgBox(ex.Message)
End Try
MsgBox("Total Files: " & CInt(ListBox2.Items.Count).ToString("#,###,###"))
This code is for listing all folders including subfolders.
but when i run this code i m getting error "Access to Path F:\System Volume Information is Denied"
How can i ignore this folder and continue scan.?
is ther any solution for this error?
Any help would be greatly appreciated.