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>

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

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

_ArrayDisplay($aSortList, '_WinAPI_PathIsContentType')