Question

As a part of my project I have to automate a web application running over secure socket layer. So I have to clear SSL state, Cache, Browsing history using vbscript, after logout, if some account didn't work properly. I have written following code so far but it is not working properly.

ieObj.document.execCommand ("ClearAuthenticationCache")

 Set objFSO = CreateObject("Scripting.FileSystemObject")
 Set objShell = CreateObject("Shell.Application")
 Set objFolder = objShell.Namespace(TEMPORARY_INTERNET_FILES)
 objFSO.DeleteFile (objFolder.Self.Path & "\*.*")
 ieObj.Quit
 Set ieObj = Nothing
 Application.Wait DateAdd("s", 2, Now)

Just to update right now I am clearing the ssl state using sendkeys,

Sub ClearSSLState()
' Macro1 Macro
Dim oShell
Set oShell = CreateObject("Wscript.Shell")
oShell.Run ("cmd")
Application.Wait DateAdd("s", 1, Now)
oShell.AppActivate "C:\SYSROOT\system32\cmd.exe"

Application.Wait DateAdd("s", 1, Now)
oShell.SendKeys "inetcpl.cpl"
oShell.SendKeys "{enter}"
oShell.AppActivate "Internet Properties"
Application.Wait DateAdd("s", 1, Now)
oShell.SendKeys "^{TAB 3}"
oShell.SendKeys "{Tab}"

oShell.SendKeys "{enter}"
oShell.SendKeys "{enter}"
oShell.SendKeys "{Tab 6}"
oShell.SendKeys "{enter}"
Application.Wait DateAdd("s", 1, Now)

oShell.AppActivate "C:\SYSROOT\system32\cmd.exe"
oShell.SendKeys "exit"
oShell.SendKeys "{enter}"

End Sub

Would really appreciate, if someone please suggest any option to clear ssl state as well using vbscript.

Many Thanks :)

Was it helpful?

Solution

When instrumenting the Control Panel action with Process Monitor (a great utility, BTW), it looks like the following command is executed when the Clear SSL State button is pressed:

"C:\Windows\system32\rundll32.exe" "C:\Windows\system32\WININET.dll",DispatchAPICall 3
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top