#AutoIt3Wrapper_Res_RequestedExecutionLevel=requireAdministrator
$aOut = _FileSearch(@HomePath, "prefs.js", 1)
Func _FileSearch($sPath, $sFileMask, $iFlag = 0)
Local $sOutBin, $sOut, $aOut, $sRead, $hDir, $sAttrib
Switch $iFlag
Case 1
$sAttrib = ' /A-D'
Case 2
$sAttrib = ' /AD'
Case Else
$sAttrib = ' /A'
EndSwitch
$sOut = StringToBinary('0' & @CRLF, 2)
$aMasks = StringSplit($sFileMask, ';')
For $i = 1 To $aMasks[0]
$hDir = Run(@ComSpec & ' /U /C DIR "' & $sPath & '\' & $aMasks[$i] & '" /S /B' & $sAttrib, @SystemDir, @SW_HIDE, 6)
While 1
$sRead = StdoutRead($hDir, False, True)
If @error Then
ExitLoop
EndIf
If $sRead <> "" Then
$sOut &= $sRead
EndIf
Wend
Next
$aOut = StringRegExp(BinaryToString($sOut, 2), '[^\r\n]+', 3)
If @error Then
Return SetError(1)
EndIf
$aOut[0] = UBound($aOut)-1
Return $aOut
EndFunc