#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here $home = @HomeDrive & @HomePath & "\" $syspart = stringleft(@windowsdir,3) local $del_home[6]; local $del_syspart[5]; $del_home[0] = "Lokale Einstellungen\Temp\"; $del_home[1] = "Lokale Einstellungen\Temporary Internet Files\"; $del_home[2] = "Lokale Einstellungen\Verlauf\"; $del_home[3] = "Recent\"; $del_home[4] = "Cookies\"; $del_home[5] = "AppData\Local\Temp\"; $del_syspart[0] = "\Windows\TEMP\" $del_syspart[1] = "\TEMP\" $del_syspart[2] = "\tmp\" ;; work around windoof 7 bug... $command = "cmd /K del /F /S /Q """ & $home & "AppData\Local\Temp\*""" run($command,@SystemDir,@SW_HIDE); for $x = 0 to UBound($del_home) -1 if(stringlen($del_home[$x]) > 0 ) then delsubfolder($home & $del_home[$x]) FileDelete($home & $del_home[$x]) endif Next for $x = 0 to UBound($del_syspart) -1 if(stringlen($del_syspart[$x]) > 0 ) then delsubfolder($syspart & $del_syspart[$x]) FileDelete($syspart & $del_syspart[$x]) endif Next delsubfolder($syspart & "WINDOWS\$",true) FileDelete($syspart & "WINDOWS\" & "*.log") func delsubfolder($path,$remove_top_too=false) $search = FileFindFirstFile($path & "*") If $search = -1 Then return false EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop if FileExists($path) = false Then $path = parentpath($path) endif if stringinstr(FileGetAttrib($path & $file),"D") Then FileDelete($path & $file & "\*") delsubfolder($path & $file & "\") DirRemove($path & $file & "\") if $remove_top_too Then DirRemove($path & "\") endif endif WEnd FileClose($search) endfunc func parentpath($path) $pathsplit = stringsplit($path, "\") $folder = "" for $x = 1 to $pathsplit[0] -1 $folder &= $pathsplit[$x] & "\" next return $folder endfunc