$Path = IniRead(@ScriptDir & "/config.ini", "Cfg", "Caminho","") $word = IniRead(@ScriptDir & "/config.ini", "Cfg", "Palavra","") $iMsgBoxAnswer = IniRead(@ScriptDir & "/config.ini", "Cfg", "Checkbox","") While 1 if $Path == '' Then MsgBox(16,"Erro", "Defina um caminho para rastreio") WinActivate("[TITLE:Find N Delet]") EndIf if $word == '' Then MsgBox(16,"Erro", "Defina uma palavra para rastreio") WinActivate("[TITLE:Find N Delet]") EndIf Searchengine($Path,$word, $iMsgBoxAnswer) ;~ MsgBox(0,'',"oi") WEnd Func Searchengine($Path,$word, $iMsgBoxAnswer) $Path = $Path ;<---- The path where all begins... dim $folders[4] $Files = "" $dirs = "" $result = "" $word = $word if $iMsgBoxAnswer == '' then $iMsgBoxAnswer = 2 If StringInStr(FileGetAttrib($path),"d") Then $folders[0] = 1 $folders[1] = $Path While 1 For $c = 1 to $folders[0] If StringRight($folders[$c],1) == "\" Then $Folders[$c] = StringLeft($folders[$c],StringLen($folders[$c])-1) $search = FileFindFirstFile($folders[$c] & "\*.*") If $search <> -1 Then While 1 $result = FileFindNextFile($search) If @error Then ExitLoop If $result <> "." AND $result <> ".." Then $result = $folders[$c] & "\" & $result If StringInStr(FileGetAttrib($result),"d") Then $dirs = $dirs & "|" & $result $files = $files & "|" & $result ; << --- Remove this line if you do not want the folders names in the final list... ;or use an other var if you want divide. Else ;~ proxima linha mudar comando ;~ If StringInStr($result, $word ) Then Msgbox(0,"",$result & " - " &$word &" exists in the string") If StringInStr($result, $word ) And Not StringInStr($result, '$RECYCLE.BIN' ) Then ;~ Msgbox(0,"",$result & " - " &$word &" exists in the string") if $iMsgBoxAnswer == 1 then $iMsgBoxAnswer = Msgbox(33,"Deletar ?","Caminho: " &$result & @CRLF & "Palavra: " &$word) Select Case $iMsgBoxAnswer = 1 ;OK FileRecycle($result) Case $iMsgBoxAnswer = 2 ;Cancel EndSelect if $iMsgBoxAnswer == 3 then FileRecycle($result) if $iMsgBoxAnswer == 4 then FileRecycle($result) EndIf EndIf EndIf WEnd FileClose($search) EndIf Next If $dirs = "" Then ExitLoop $folders = 0 $dirs = StringRight($dirs,StringLen($dirs) - 1) $folders = StringSplit($dirs,"|") $dirs = "" WEnd EndIf ;~ $files = StringRight($files,StringLen($files) - 1) ;~ $files = StringReplace($files,"|",@crlf) ;~ FileWrite("l:\list.txt",$files) Exit EndFunc