cancel
Showing results for 
Search instead for 
Did you mean: 

How to ClearCache and Cookies from Internet Explorer 9

SOLVED
Occasional Contributor

How to ClearCache and Cookies from Internet Explorer 9

How to ClearCache and Cookies for Internet Explorer 9 in test complete using vb script as the language .



Please help .
1 ACCEPTED SOLUTION

Accepted Solutions
Regular Contributor

RE: How to ClearCache and Cookies from Internet Explorer 9

You can use the following call to clear cache, cookies, passwords, and anything else. If you want to be more selective you will have to change the 255 value to something else. You should be able to find the proper values through Google...



    Set objShell = CreateObject("WScript.Shell")

    objShell.Run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255"






5 REPLIES 5
Regular Contributor

RE: How to ClearCache and Cookies from Internet Explorer 9

You can use the following call to clear cache, cookies, passwords, and anything else. If you want to be more selective you will have to change the 255 value to something else. You should be able to find the proper values through Google...



    Set objShell = CreateObject("WScript.Shell")

    objShell.Run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255"






Regular Contributor

RE: How to ClearCache and Cookies from Internet Explorer 9

Also here are the equivalents for Chrome and Firefox:



' Clears the Chrome cache, passwords, cookies, etc...

Sub ClearAllChromeStoredInfo

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    

    strAppDataFolder = AQEnvironment.GetEnvironmentVariable("LocalAppData") & "\Google\Chrome\User Data\Default"

    

    Set FilesInFolder = objFSO.GetFolder(strAppDataFolder).Files

    Set FoldersInFolder = objFSO.GetFolder(strAppDataFolder).SubFolders

    

    For Each Folder In FoldersInFolder

        If Not UCase(Folder.Name) = "EXTENSIONS" _

        And Not UCase(Folder.Name) = "EXTENSION STATE" Then

            Folder.Delete True

        End If

    Next

    

    For Each File In FilesInFolder

        If Not UCase(File.Name) = "PREFERENCES" Then File.Delete

    Next

    

End Sub



' Clears the Firefox cache, passwords, cookies, etc...

Sub ClearAllFirefoxStoredInfo

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    

    strLocalAppData = AQEnvironment.GetEnvironmentVariable("LocalAppData") & "\Mozilla\Firefox\Profiles"

    strRoamingAppData = AQEnvironment.GetEnvironmentVariable("AppData") & "\Mozilla\Firefox\Profiles"



    Set FoldersInFolder = objFSO.GetFolder(strLocalAppData).SubFolders

    For Each Folder In FoldersInFolder

        Folder.Delete True

    Next

    

    Set FoldersInFolder = objFSO.GetFolder(strRoamingAppData).SubFolders

    For Each Folder In FoldersInFolder

        Set FilesInFolder = Folder.Files

        For Each File in FilesInFolder

            If Instr(1, File.Name, "sqlite") > 0 Then File.Delete

        Next

    Next

    

End Sub
Occasional Contributor

RE: How to ClearCache and Cookies from Internet Explorer 9

Thanks a lot Hugo  Smiley Happy
Community Hero

RE: How to ClearCache and Cookies from Internet Explorer 9

Command-line versions of Hugo's code:

http://www.catonmat.net/blog/clear-privacy-ie-firefox-opera-chrome-safari/
Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Super Contributor

Re: RE: How to ClearCache and Cookies from Internet Explorer 9

Can Some one provide me how to clear cache and cookies from the browsers using JavaScript ?

 

Please advise

 

Thanks

NG

New Here?
Join us and watch the welcome video:
Join the September Hub-bub to show off, learn and win