Private Declare Function SearchTreeForFile Lib "imagehlp" (ByVal RootPath As String, ByVal InputPathName As String, ByVal OutputPathBuffer As String) As Long Private Const MAX_PATH = 260 Private Sub Form_Load() Dim tempStr As String, ret As Long 'create a buffer string tempStr = String(MAX_PATH, 0) 'returns 1 when successfull, 0 when failed ret = SearchTreeForFile("c:\", "readme.txt", tempStr) If ret <> 0 Then ' show the file, making sure no null chars are shown MsgBox "Located file at " + Left$(tempStr, InStr(1, tempStr, Chr$(0)) - 1) Else MsgBox "File not found!" End If End Sub