作为我项目的一部分,我必须自动化运行在安全套接字层上的 Web 应用程序。因此,如果某些帐户无法正常工作,我必须在注销后使用 vbscript 清除 SSL 状态、缓存、浏览历史记录。到目前为止,我已经编写了以下代码,但它无法正常工作。
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)
只是为了现在更新,我正在使用 sendkeys 清除 ssl 状态,
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
非常感谢,如果有人请建议使用 vbscript 清除 ssl 状态的任何选项。
非常感谢:)
最佳答案
使用 Process Monitor 检测控制面板操作时(一个很棒的实用程序,顺便说一句),当按下 Clear SSL State 按钮时,看起来会执行以下命令:
"C:\Windows\system32\rundll32.exe" "C:\Windows\system32\WININET.dll",DispatchAPICall 3
关于ssl - 使用 vbscript 清除 SSL 状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13232700/