Opt("TrayIconHide", 1);0=show, 1=hide tray icon $pattern = InputBox("pattern","search pattern (RegEx):",".pdf") $res = msgbox(1,"WIRKLICH??","Wirklich alle " & $pattern & "-Dateien/Verzeichnisse Rekursiv löschen???") if($res <> 1 ) Then exit endif getfiles("."); msgbox(0,0,"Done...") func getfiles($dir) $search = FileFindFirstFile($dir & "\*") ; Check if the search was successful If $search = -1 Then ;MsgBox(0, "Error", "No files/directories matched the seif(StringRegExp($file,"*.pdf",0) = 1) thenarch pattern") ;Exit Else ;msgbox(0,0,"found") EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $attrib = FileGetAttrib($dir & "\" & $file) ; msgbox(0,0,"ALL:" & $dir & "/" & $file & "-" & $attrib ); ; if($attrib = "D" or $attrib = "HD") then ; = DIRECTORY ;if($file = ".svn") Then ;if(StringRegExp($file,"*.pdf",0) = 1) then if(compare($file,$pattern)) then $dirohnepunkt = stringright($dir,stringlen($dir)-1) $fullpath = @scriptdir & "\" & $dirohnepunkt & "\" & $file ;msgbox(0,0,$fullpath); DirRemove($fullpath,1) filedelete($fullpath); else if($attrib = "D" or $attrib = "HD") then ;msgbox(0,0,"MORE:" & $dir & "\" & $file); getfiles($dir & "\" & $file); endif endif ; endif WEnd ; Close the search handle FileClose($search) endfunc func compare($pfile, $ppattern) ;msgbox(0,0,$pfile); if(StringRegExp($pfile,$ppattern,0) = 1) then return true Else return False endif endfunc