Programmatically add trusted sites to Internet Explorer

后端 未结 7 1916
星月不相逢
星月不相逢 2020-11-29 06:42

I\'m doing an IE automation project using WatiN.

When a file to be downloaded is clicked, I get the following in the Internet Explorer Information bar:

相关标签:
7条回答
  • 2020-11-29 07:43

    Using powershell it is quite easy.

    #Setting IExplorer settings
    Write-Verbose "Now configuring IE"
    #Add http://website.com as a trusted Site/Domain
    #Navigate to the domains folder in the registry
    set-location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    set-location ZoneMap\Domains
    
    #Create a new folder with the website name
    new-item website/ -Force
    set-location website/
    new-itemproperty . -Name * -Value 2 -Type DWORD -Force
    new-itemproperty . -Name http -Value 2 -Type DWORD -Force
    new-itemproperty . -Name https -Value 2 -Type DWORD -Force
    
    0 讨论(0)
提交回复
热议问题