# Function Reference

# _WinAPI_PathFindOnPath

Searchs for a file in the default system paths

#include <WinAPIShPath.au3>
_WinAPI_PathFindOnPath ( $sFilePath [, $aExtraPaths = "" [, $sPathDelimiter = @LF]] )

## Parameters

$sFilePath | Filename to search for
$aExtraPaths | [optional] Extra paths to check before any others.
$sPathDelimiter | [optional] Delimiter used to split $aExtraPaths if it's an non-empty string (StringSplit() with flag $STR_NOCOUNT (2)).

## Return Value

Success: | the full path of found file.
Failure: | sets the @error flag to non-zero, filename Unchanged.

## Remarks

$aExtraPaths can contain a list of paths to be checked before any system defaults.
It can be an array or a string. If the former, it shall not have a count in it's first element.
If the latter, it will be split using $sPathDelimiter as the delimiter, that defaults to @LF.

## See Also

Search PathFindOnPath in MSDN Library.

## Example

    #include <MsgBoxConstants.au3>
    #include <WinAPIShPath.au3>

    MsgBox($MB_SYSTEMMODAL, "PathFindOnPath Example", _
            StringFormat("Full path of notepad.exe:\n%s\n\n" & _
            "Find ntuser.dat in profile folder, using custom paths:\n%s", _
            _WinAPI_PathFindOnPath("notepad.exe"), _WinAPI_PathFindOnPath("ntuser.dat", @UserProfileDir) _
            ))