# Function Reference

# _WinAPI_PathIsExe

Determines whether a file is an executable by examining the file extension

#include <WinAPIShPath.au3>
_WinAPI_PathIsExe ( $sFilePath )

## Parameters

$sFilePath | The path to be searched.

## Return Value

True: | the file extension is .cmd, .bat, .pif, .scf, .exe, .com, or .scr.
False: | no the file extension.

## See Also

Search PathIsExe in MSDN Library.

## Example

    #include <Array.au3>
    #include <File.au3>
    #include <WinAPIShPath.au3>

    _Example()
    Func _Example()
        Local $aFileList = _FileListToArray(@SystemDir, '*.*', 1)
        Local $aSortList[UBound($aFileList) - 1]
        Local $iCount = 0

        For $i = 1 To $aFileList[0]
            If _WinAPI_PathIsExe($aFileList[$i]) Then
                $aSortList[$iCount] = $aFileList[$i]
                $iCount += 1
            EndIf
        Next
        If $iCount Then
            ReDim $aSortList[$iCount]
        Else
            Exit
        EndIf

        _ArrayDisplay($aSortList, '_WinAPI_PathIsContentType')
    EndFunc   ;==>_Example