天天看點

Javascript 系統資料庫添加IE信任站點及啟用Activex控件詳解

客戶抱怨系統要手工設定安全站點,上司是電腦肓,不會搞!

修改系統資料庫添加IE信任站點及啟用Activex控件

//

//    添加資訊站點及将指定IP添加到本地Intranet中,

//    "*"=dword:00000002 表示受信任的站點區域

//    "*"=dword:00000001 表示本地 Intranet 區域

//

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/ZoneMap/Ranges]

@=""

[HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/ZoneMap/Ranges/Range100]

"*"=dword:00000002

":Range"="192.168.10.121"

[HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/ZoneMap/Ranges/Range101]

"*"=dword:00000001

":Range"="192.168.10.121"

[HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/Zones/2]

@=""

"DisplayName"="可信站點"

"CurrentLevel"=dword:00001000

"Flags"=dword:00000043

"1004"=dword:00000000

"1201"=dword:00000000

"1402"=dword:00000000

"2201"=dword:00000000

[HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/Zones/1]

@=""

"DisplayName"="本地 Intranet"

"CurrentLevel"=dword:00000000

"1001"=dword:00000000

"1004"=dword:00000000

"1201"=dword:00000000

[HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/Zones/3]

@=""

"DisplayName"="Internet"

"CurrentLevel"=dword:00000000

"1001"=dword:00000000

"1004"=dword:00000000

"1201"=dword:00000000

/

//

// 通過網頁修改activex安全設定,添加信任站點,禁用彈出視窗阻止程式

//

/

信任站點的系統資料庫項

HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/ZoneMap/Ranges/Range[*]

ActiveX的系統資料庫項

HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/Zones/[0-4]/[*]

[0-4]

值           設定

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

0          我的電腦

1          本地 Intranet 區域

2          受信任的站點區域

3          Internet 區域

4          受限制的站點區域

[*]

1001       下載下傳已簽名的 ActiveX 控件

1004       下載下傳未簽名的 ActiveX 控件

1200       運作 ActiveX 控件和插件

1201       對沒有标記為安全的 ActiveX 控件進行初始化和腳本運作

1405       對标記為可安全執行腳本的 ActiveX 控件執行腳本

2201       ActiveX 控件自動提示 **

彈出視窗阻止程式的系統資料庫項

HKEY_CURRENT_USERHKCU/Software/Microsoft/Internet Explorer/New Windows/PopupMgr

具體腳本如下:

<SCRIPT LANGUAGE="JavaScript">

<!--

var WshShell=new ActiveXObject("WScript.Shell");

//添加信任站點ip

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range100//","");

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range100//http","2","REG_DWORD");

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range100//:Range","192.168.0.1");

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range101//","");

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range101//http","2","REG_DWORD");

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range101//:Range","192.168.0.2");

//修改IE ActiveX安全設定

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");

//禁用xinxp彈出視窗阻止程式

WshShell.RegWrite("HKCU//Software//Microsoft//Internet Explorer//New Windows//PopupMgr","no");

alert("active控件安全設定,彈出視窗設定,信任站點設定成功");

//-->

</SCRIPT>

URL:

比如說我們要把www.Microsoft.com添加到客戶的受信任站點

1.運作regedit,打開系統資料庫,首先打開下面的鍵值

HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Inte

rnet Settings/ZoneMap/Domains

2.在其下面建立一個項命名為"Microsoft.com"

3.在Microsoft.com下面再建立一個項,命名為"www"

4.在www下新鍵一個雙位元組子鍵,命名為"*","*"表示任何協定,你還可以把

"*"替換為"http","ftp"等其它名稱

5.輕按兩下剛才建立的雙位元組子鍵"*",確定基數裡選擇是"十六進制",在數值

資料種填寫"2"

6.關閉系統資料庫

<SCRIPT LANGUAGE="JavaScript">

<!--

var WshShell=new ActiveXObject("WScript.Shell");

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVe

rsion//Internet Settings//ZoneMap//Domains//Microsoft.com","");

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVe

rsion//Internet Settings//ZoneMap//Domains//Microsoft.com//www","");

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVe

rsion//Internet

Settings//ZoneMap//Domains//Microsoft.com//www//http","2","REG_DWORD"

);

alert("寫入成功");

//-->

</SCRIPT>

繼續閱讀