VB Code:
Option Explicit
Private Declare Function PathFileExists Lib "shlwapi.dll" Alias "PathFileExistsA" (ByVal pszPath As String) As Long
Private Sub Dir1_Change()
Form1.Caption = Dir1.List(0)
End Sub
Private Sub Form_Load()
Dim fexists, x As Boolean
Dim filename As String
Dim i As Long
fexists = False
'write the path you want to search (it will search all folders within for file)
Dir1.Path = "d:\bin\"
'set the file name you are searching for
filename = "w.txt"
For i = 0 To Dir1.ListCount - 1
x = PathFileExists(Dir1.List(i) + "\" + filename)
If x = True Then fexists = True
Next
'fexists is true if file was found, else it is false
Form1.Caption = fexists
End Sub