通过脚本将网址添加到客户的受信任站点

时间:2022-03-03 04:35:11

比如说我们要把http://blog.csdn.net添加到客户的受信任站点


1.运行regedit,打开注册表,首先打开下面的键值

HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/ZoneMap/Domains

2.在其下面新建一个项命名为"csdn.net"

3.在cofdjj.com下面再新建一个项,命名为"blog"

4.在www下新键一个双字节子键,命名为"*",  "*" 表示任何协议,你还可以把"*"替换为"http","ftp"等其它名称


5.双击刚才新建的双字节子键"*",确保基数里选择是"十六进制",在数值数据中填写"2"


6.关闭注册表

<SCRIPT LANGUAGE="JavaScript">
<!--
var WshShell=new ActiveXObject("WScript.Shell");
WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Domains//csdn.net","");

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Domains//csdn.net//blog","");

WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet
Settings//ZoneMap//Domains//csdn.net//blog//http","2","REG_DWORD" );

alert("写入成功");
//-->
</SCRIPT>