Set ie trusted site and ActiveX settings in JS

Source: Internet
Author: User
Tags ranges

Set ie trusted site and ActiveX settings in JS

Modify ActiveX security settings on the webpage, add a trusted site, and disable pop-up blocking.Program

Registry Key of the trusted site: HKEY_CURRENT_USER/software/Microsoft/Windows/CurrentVersion/Internet Settings/zonemap/Ranges/range [*]

ActiveX registry key: HKEY_CURRENT_USER/software/Microsoft/Windows/CurrentVersion/Internet Settings/zones/[0-4]/[*]

[0-4]

Value settings

------------------------------

0 my computer

1. Local intranet Region

2. trusted site regions

3. Internet region

4 restricted site regions

[*]

1001 download the signed ActiveX Control

1004 download unsigned ActiveX Controls

1200 Run ActiveX controls and plug-ins

1201 initialize ActiveX controls that are not marked as secure and run scripts

1405 execute scripts on ActiveX controls marked as secure Script Execution

2201 ActiveX Control prompt

In the pop-up window, the Registry Key of the blocking program is hkey_current_userhkcu/software/Microsoft/Internet Explorer/new windows/popupmgr.

The specific script is as follows:

<Script language = "JavaScript" >

VaR Wshshell = New Activexobject ( "Wscript. Shell" );

// Add a trusted site (http: // 192.168.1.5)

Wshshell. regwrite ( "Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ zonemap \ ranges \ range100 \\"," ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ zonemap \ ranges \ range100 \: Range "," 10.114.72.139 ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ zonemap \ ranges \ range100 \ HTTP "," 2 "," REG_DWORD ");

// Modify IE ActiveX Security Settings: 1. Local intranet Region

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 1 \ 1001 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 1 \ 1004 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 1 \ 1200 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 1 \ 1201 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 1 \ 1405 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 1 \ 2201 "," 0 "," REG_DWORD ");

// Modify IE ActiveX Security Settings: 2. trusted site REGION

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 2 \ 1001 "," 0 "," REG_DWORD");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 2 \ 1004 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 2 \ 1200 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 2 \ 1201 "," 0 "," REG_DWORD");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 2 \ 1405 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 2 \ 2201 "," 0 "," REG_DWORD ");

// Modify IE ActiveX Security Settings: 3internet Region

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 1001 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 1004 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 1200 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 1201 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 1405 "," 0 "," REG_DWORD ");

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 2201 "," 0 "," REG_DWORD ");

// Disable the WINXP pop-up window blocking program

Wshshell. regwrite (" Hkcu \ Software \ Microsoft \ Internet Explorer \ new Windows \ popupmgr "," No ");

</SCRIPT>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.