#include <File.au3>
#include <Array.au3>
Global $path[3] ;4 пути
$path[0] = "C:\Temp"
$path[1] = "C:\Tmp"
$path[2] = "C:\ShareFolder"
$aReturn = _FileSearch($path, '*.tmp')
For $i = 1 To UBound($aReturn) - 1
;FileDelete($aReturn[$i])
FileRecycle($aReturn[$i])
Next
ExitLoop
EndSelect
Sleep(10000) ; Пауза 10секунд
WEnd
_DirRemoveEmptyTime($path[3])
Func _FileSearch($sPath, $sFileMask)
Local $sOut = StringToBinary("0" & @CRLF, 2), $aOut
Local $hDir = Run(@ComSpec & ' /U/C DIR "' & $sPath & '\' & $sFileMask & '" /S/B/A-D', @SystemDir, @SW_HIDE, 6)
While 1
$sOut &= StdoutRead($hDir, False, True)
If @error Then ExitLoop
WEnd
$aOut = StringRegExp(BinaryToString($sOut, 2), "[^\r\n]+", 3)
If @error Then Return SetError(1)
$aOut[0] = UBound($aOut) - 1
Return $aOut
EndFunc ;==>_FileSearch