Jump to content
Sign in to follow this  
jianny

How to clear ie cache.

Recommended Posts

jianny

How to clear ie cache.

Share this post


Link to post
Share on other sites
SeF

$ClearID = "8"
Run("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess " & $ClearID)

;You can delete/clear others things by changing $ClearID's value:
;History Only = 1
;Cookies Only = 2
;Temporary Internet Files Only = 8
;Form Data Only = 16
;Password History Only = 32
;Everything = 255


Share this post


Link to post
Share on other sites
wakillon

hi Sef ! Posted Image

I use Chrome, is that it will work for ?

Or do you know another way...


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
jianny

$ClearID = "8"
Run("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess " & $ClearID)

;You can delete/clear others things by changing $ClearID's value:
;History Only = 1
;Cookies Only = 2
;Temporary Internet Files Only = 8
;Form Data Only = 16
;Password History Only = 32
;Everything = 255

My IE6 can not use it.

Share this post


Link to post
Share on other sites
Juvigy

This is valid for IE7 + . For chrome i would suggest to find the dir where it stores the files and delete manually with filedelete or dirremove functions.

Share this post


Link to post
Share on other sites
wakillon

I found a sulution for Delete cache of Chromium Family browser ( Google chrome, Chromium, Iron... ) Posted Image

There is an option for delete password and cookies too...

#cs

    Script To Clear Chromium Family browser cache ( Google chrome, Chromium, Iron... )
    Adapted of script found on http://www.winhelponline.com/blog/quickly-clear-the-google-chrome-cache-using-script/ 
    Customizations  To clear stored passwords and Cookies, change : $_ClearPasswordsAndCookies = 0 To $_ClearPasswordsAndCookies = 1 

#ce

$_ClearPasswordsAndCookies = 0
$WshShell = ObjCreate ( "WScript.Shell" )
$objFSO = ObjCreate ( "Scripting.FileSystemObject" )
$_DirtyFlags = 0
$_Msg1 = "Google Chrome cache is cleared !" 
$_Msg2 = "Google Chrome cache could not be cleared !"

If @OSVersion = "WIN_XP" Then
    $_CacheLoc = $WshShell.ExpandEnvironmentStrings ( "%USERPROFILE%" ) & "\Local Settings\Application Data\Google\Chrome\User Data\Default"
Else ; vista, seven
    $_CacheLoc = $WshShell.ExpandEnvironmentStrings ( "%LocalAppData%" ) & "\Google\Chrome\User Data\Default"
EndIf
If FileExists ( $_CacheLoc ) Then 
    If ProcessExists ( 'Chrome.exe' ) Then Exit Msgbox ( 0, 'Exiting', 'Google Chrome Not close' & @CRLF & @CRLF & 'Close your Chrome browser first !' & @CRLF )
Else
    $_CacheLoc = StringReplace ( $_CacheLoc, 'Google\Chrome', 'Chromium' ) ; if not chrome user try chromium user.
    If Not FileExists ( $_CacheLoc ) Then Exit Msgbox ( 0, 'Exiting', 'Google Chrome Not found' & @CRLF & @CRLF & 'And Chromium browser Not found too ! ' & @CRLF )
    If ProcessExists ( 'Chromium.exe' ) Or ProcessExists ( 'iron.exe' ) Then Exit Msgbox ( 0, 'Exiting', 'Chromium Not close' & @CRLF & @CRLF & 'Close your Chromium or Iron browser first !' & @CRLF )
EndIf

$_CacheSize = Round ( DirGetSize ( $_CacheLoc & '\Cache' ) / 1024 /1024 )
Msgbox ( 0, 'Found', 'Cache Directory Size : ' & $_CacheSize & ' MB', 3 )

If $objFSO.FolderExists ( $_CacheLoc ) Then
    $objFolder = $objFSO.GetFolder ( $_CacheLoc )
    $colFiles = $objFolder.Files
    For $objFile in $colFiles
        If $_ClearPasswordsAndCookies = 0 Then
            If $objFile.Name <> "Current Session" And $objFile.Name <> "Current Tabs" And $objFile.Name <> "Cookies" And $objFile.Name <> "Bookmarks" And $objFile.Name <> "Preferences" And $objFile.Name <> "Web Data" Then $objFSO.DeleteFile ( $objFile )
        Else
            If $objFile.Name <> "Current Session" And $objFile.Name <> "Current Tabs" And $objFile.Name <> "Preferences" And $objFile.Name <> "Bookmarks" Then $objFSO.DeleteFile ( $objFile )
        EndIf
        If @error <> 0 Then $_DirtyFlags = 1
    Next
    If $objFSO.FolderExists ( $_CacheLoc & "\cache" ) Then $objFSO.deletefolder ( $_CacheLoc & "\cache" )
    If @error <> 0 Then $_DirtyFlags = 1
    If $_DirtyFlags = 1 Then
        Msgbox ( 0, 'Error', $_Msg2, 5 )
    Else
        Msgbox ( 0, 'Success',  $_Msg1, 5 )
    EndIf
EndIf

Exit

If Windows Seven's users can tell me if cache directory path is same than vista ! Posted Image

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×