Func ScanFolder(const $Path) Local $search = FileFindFirstFile($Path & "\*.*") Local $FullPath If $search = -1 Then Return Local $first = 1 If $first = 1 Then FileWriteLine($openFile, "=====================") EndIf While 1 Local $file = FileFindNextFile($search) If @error Then ExitLoop ;break Local $test $FullPath = $Path & "\" & $file If Not StringInStr(FileGetAttrib($FullPath), "D") Then FileWrite($openFile, $file) Local $testOpen = FileOpen($FullPath, $FO_READ) ;just read the file If $testOpen = -1 Then FileWriteLine($openFile, " -> Error!") Else $PID = ShellExecute($FullPath) If $PID = -1 Then $ErrorCount += 1 FileWriteLine($openFile, " -> Error! : with return" & $PID) EndIf Else ;... EndIf FileClose($FullPath) FileWrite($openFile, $file & " close complete!" & @CRLF) Else FileWriteLine($openFile, $file) EndIf If IsFolder($FullPath) = 1 Then ScanFolder($FullPath); if still have folder then sreach it recursively $FolderCount += 1 Else $FileCount += 1 EndIf WEnd FileWrite($openFile, @CRLF) FileWrite($openFile, "=====================" & @CRLF) FileClose($search) EndFunc