#include <Array.au3>
Local $aFile = _FileFind('C:\Program Files (x86)\Kingsoft\WPS Office\*', '\utility\uninst.exe')
_ArrayDisplay($aFile)
Func _FileFind($sPath, $sFile)
Local $hSearch = FileFindFirstFile($sPath)
If $hSearch = -1 Then Return MsgBox(0, '', '错误: 没有匹配的文件/目录.')
Local $aPath = StringRegExp($sPath, '^(.*)([^\\]*[\*\?][^\\]*)$', 1)
If @error Then Return MsgBox(0, '', '搜索格式错误')
If $aPath[0] = '' Then $aPath[0] = @ScriptDir & '\'
Local $sFileName, $sList = ''
While 1
$sFileName = FileFindNextFile($hSearch)
If @error Then ExitLoop
If @extended And FileExists($aPath[0] & $sFileName & $sFile) Then $sList &= $aPath[0] & $sFileName & $sFile & @CRLF
WEnd
FileClose($hSearch)
If $sList = '' Then Return MsgBox(0, '', '错误: 没有找到匹配的文件.')
Return StringRegExp($sList, '\V+', 3)
EndFunc ;==>_FileFind
|