I don't know if VFP has what you want, but I believe that Delphi has a function called FindFirst( some parameters including filename). If you need to look for the same name again in some other directory or used wildcards in the filename. I'm pretty certain that these functions are wrappers for a Windows API. I'll look up the source in Delphi later and try to send a better answer.
Regards,
Mike
Mike