Is this can help?
Searching for the specified file using the SearchPathhttp://www.news2news.com/vfp/?example=250&function=397The code uses
SearchPath function from kernel32 API:
DECLARE INTEGER SearchPath IN kernel32;
STRING lpPath,;
STRING lpFileName,;
STRING lpExtension,;
INTEGER nBufLen,;
STRING @ lpBuffer,;
INTEGER @ lpFilePart
By default, the function searches for a matching file in the following directories in the following sequence:
The directory from which the application loaded.
The current directory.
The system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit system directory. There is no function that retrieves the path of this directory, but it is searched.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.