Hello here is my code:
vb.net Code:
Module FileCheck Public BW_AntiCorrupt As New Threading.Thread(AddressOf AntiCorrupt) Dim THardDrive As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) Dim HardDrive As String = THardDrive.Substring(0, THardDrive.IndexOf("\") + 1) 'C:\ Public ContinueSearch As Boolean = True Public Results As New List(Of String) Public DoneGather As Boolean = False Public DiagnosticReport As String Public Sub AntiCorrupt() Dim DirInfo As New IO.DirectoryInfo(HardDrive) DoneGather = False Results.AddRange(IO.Directory.GetFiles(HardDrive, "*.*", IO.SearchOption.AllDirectories)) DoneGather = True For Each file As String In Results If ContinueSearch = True Then CheckFile(file) End If Next End Sub Private Sub CheckFile(ByVal file As String) Dim finfo As New IO.FileInfo(file) End Sub End Module
This code is being called wit this code:
vb.net Code:
BW_AntiCorrupt.IsBackground = True BW_AntiCorrupt.Start() frmFileCheckResults.Show()
I am having a problem. The IO.Directory.GetFiles code is resulting in error do to the fact that it is trying to access the Temp folder in the Windows folder on drive C:\. Apparently that folder is restricted... When the code encounters that folder the code stops retrieving files.
Is there a way around this? Is there somewhere i can give my program administrator access? If not then am i able to skip the files in that location?




Reply With Quote