Delete cookies or cache from IE
Question ID: 105219
0
0

I want to know how to programmatically remove cookies from IE or how to delete the cache and maybe even passwords using QTP and UFT?

Marked as spam
Posted by (Questions: 227, Answers: 22)
Asked on January 28, 2014 2:58 pm
65 views
Answers (1)
2
Private answer

You can use the following template to clean various data from IE depending on what you need to do. Basically, just run the steps that you want and remove or comment the lines that you don't need. Below are the most common ones:

Dim objShell
Set objShell = CreateObject(''WScript.Shell'')

objShell.Run (''RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8'') 'Delete IE Browsing History

objShell.Run (''RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2'') 'Delete Cookies

objShell.Run (''RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1'') 'Delete History

objShell.Run (''RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16'') 'Delete Form Data

objShell.Run (''RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32'') 'Delete Passwords

Wscript.Quit

*************************************************************************************************************************************************************

*Note: You can add the following two addtional lines if you want these instead. I've commented above and below what each one does to make it easier:

objShell.Run (''RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 'Delete All

objShell.Run (''RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351 'Delete any files and settings stored by addons for IE

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on January 28, 2014 3:00 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top