JimmyCollins Posted November 8, 2007 Share Posted November 8, 2007 Hi, Does any one know how to clear the Temporary Internet Files using AutoIT? These are not files, but links to files? Thanks, JC Link to comment Share on other sites More sharing options...
Joon Posted November 8, 2007 Share Posted November 8, 2007 This may not be the best way, but works. $StageFlags = 'StateFlags0100' $loop = 0 $RegRootkey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\VolumeCaches' While 1 $loop += 1 $Regkey = RegEnumKey($RegRootkey,$loop) If @error <> 0 then ExitLoop If $Regkey = 'Internet Cache Files' Then RegWrite($RegRootkey & '\' & $Regkey, $StageFlags, 'REG_DWORD', 2) Else RegWrite($RegRootkey & '\' & $Regkey, $StageFlags, 'REG_DWORD', 0) EndIf ConsoleWrite('Registry Key : ' & $Regkey & @LF) WEnd RunWait('cleanmgr.exe /sagerun:100') $loop = 0 While 1 $loop += 1 $Regkey = RegEnumKey($RegRootkey,$loop) If @error <> 0 then ExitLoop RegDelete($RegRootkey & '\' & $Regkey, $StageFlags) WEnd Or... You can convert this ScriptingGuys script to AutoIt. Const TEMPORARY_INTERNET_FILES = &H20& Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(TEMPORARY_INTERNET_FILES) Set objFolderItem = objFolder.Self strPath = objFolderItem.Path & "\*.*" Set objFSO = CreateObject("Scripting.FileSystemObject") objFSO.DeleteFile(strPath) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now