This procedure finds a file and returns the full path, provided a partial path it will search all sub dirs. No looping only 1 API - this is the kind.
I can't really take credit for putting an api to use, just sharing something that you might find useful.
Inputs
sFile: File name to find.
sRootPath: Path to begin the search in
Assumes
I know of two limitations:
1. The api has a maximum path depth of 32 directories (this is documented).
If a directory that the current user does not have access rights to resides in the directory that the search starts in the api call will fail without warning (this is NOT documented).
Returns
Returns the full file path if found otherwise returns null string
API DeclarationsDeclare Function SearchTreeForFile Lib "IMAGEHLP.DLL" (ByVal lpRootPath As String, ByVal lpInputName As String, ByVal lpOutputName As String) As Long