Hi there,
I am stuck at the moment with a silly
issue, i am using a file searcher in vb to inventory a drive and it stops as soon as it hits a protected file.
i need it to be able to skip the file or folder and resume the next target, now you would think a
Code:
On Error Resume Next
Tag would solve this but its not. here is my code:
Search Method:
Code:
Sub Search(ByVal RootDir As IO.DirectoryInfo)
For Each File In RootDir.GetFiles(txt_target.Text)
lstMusicFiles.Items.Add(File.FullName) 'process the file
Current_DIR.Text = (File.Directory.Name)
Current_FILE.Text = (File.Name)
names = File.Name
lstMusicFiles.Update()
Me.Update()
Next
For Each SubDir In RootDir.GetDirectories()
Search(SubDir)
Next
End Sub
Code:
Private Sub start()
Dim RootDir As New IO.DirectoryInfo(txt_path.Text)
Try
Search(RootDir)
Catch ex As Exception
errorh.error_console.Text = (vbCrLf & "Scan Aborted because of the following Error: " & ex.Message)
txt_error.Text = "Scan Finished @ " & DateAndTime.Now
End Try
If lstMusicFiles.Items.Count <= 0 Then
txt_error.Text = "No Target Files Found at Target Path."
Else
End If
results.GroupBox1.Visible = True
End Sub
If any one can help i would much appreciate it, thank you.