문제

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 :)

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top