giorgio007 Posted July 13, 2014 Share Posted July 13, 2014 (edited) Hi all! What to do if while I browsing, I want to delete cache? without error message What should rewrite? expandcollapse popup#cs Script To Clear Chromium Family browser cache ( Google chrome, Chromium, Iron... ) Adapted of script found on <a href='http://www.winhelponline.com/blog/quickly-clear-the-google-chrome-cache-using-script/' class='bbc_url' title='External link' rel='nofollow external'>http://www.winhelponline.com/blog/quickly-clear-the-google-chrome-cache-using-script/</a> 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 Edited July 13, 2014 by giorgio007 Link to comment Share on other sites More sharing options...
Bert Posted July 13, 2014 Share Posted July 13, 2014 You can start by not Necroposting. Second, you can start a new thread. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 13, 2014 Moderators Share Posted July 13, 2014 giorgio007,Welcome to the AutoIt forums. I have started a new thread for you - please do the same rather then necro-post in future. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
giorgio007 Posted July 13, 2014 Author Share Posted July 13, 2014 Thank U. Link to comment Share on other sites More sharing options...
Bert Posted July 14, 2014 Share Posted July 14, 2014 You could run CCleaner with command line switches. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
giorgio007 Posted July 14, 2014 Author Share Posted July 14, 2014 I understand, and thank you, but I want to use the script. Unfortunately, I do not know what to rewrite... I can't use while browsing, cause script send me error message. Link to comment Share on other sites More sharing options...
Bert Posted July 15, 2014 Share Posted July 15, 2014 Look here: https://chrome.google.com/webstore/detail/clear-cache-shortcut/jnajhcakejgchhbjlchkfmdidgjefleg?hl=en The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
giorgio007 Posted July 15, 2014 Author Share Posted July 15, 2014 Really works! Thank U MBALZESHARI Link to comment Share on other sites More sharing options...
Bert Posted July 15, 2014 Share Posted July 15, 2014 welcome The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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