Problem with using SearchTreeForFile to find files
Hi,
I am trying to find a file on a machine using
SearchTreeForFile(RootPath, FileName, sBuffer)
It seems to work fine on Win 98 and 2000, but on NT machines with Sp5 it returns 0 indicating that the file does not exist, but it does.
What is wrong and how can I correct it?
SearchTreeForFile return empty string
When I do it like this the SearchTreeForFile returns false, but the file does exist on the sDrive2Scan.
Dim str As String
str = Space(MAX_PATH)
If SearchTreeForFile(sDrive2Scan, sFile2Find, sResult) Then
ff = Left(sResult, InStr(str, vbNullChar) - 1)
Else
ff = "File not found: " & Err.LastDllError
End If
This works on Win 2000 and 9X, but not on Win NT SP5.
What could be the error?