Looking for a better way to search for a file to see if it exists.
I am currently using this and it works if you put in the exact directory path. I was wondering if there would be a way to get it to search the entire c: hard drive to see if the file exists even if it's in a sub directory of a subdirectory of a directory etc...
Code:Dim Check As Integer, filepath As String filepath = "C:\abc.txt" Check = Len(Dir$(filepath)) If Check = 0 Then MessageBox.Show("Found it") ElseIf Check <> 0 Then MessageBox.Show("Nowhere around") End If




Reply With Quote