Détermine si un fichier est un exécutable en examinant l'extension du fichier
#include <WinAPIShPath.au3>
_WinAPI_PathIsExe ( $sFilePath )
$sFilePath | Le chemin dans lequel rechercher. |
True: | L'extension de fichier est .cmd, .bat, .pif, .scf, .exe, .com, ou .scr. |
False: | L'extension du fichier est autre. |
Consultez PathIsExe dans la librairie MSDN.
#include <Array.au3> #include <File.au3> #include <WinAPIShPath.au3> _Example() Func _Example() Local $aFileList = _FileListToArray(@SystemDir, '*.*', 1) Local $aSortList[UBound($sFileList) - 1] Local $iCount = 0 For $i = 1 To $aFileList[0] If _WinAPI_PathIsExe($sFileList[$i]) Then $aSortList[$iCount] = $aFileList[$i] $iCount += 1 EndIf Next If $iCount Then ReDim $aSortList[$iCount] _ArrayDisplay($aSortList, '_WinAPI_PathIsExe') EndIf EndFunc