<html>
<body>
<script language="JavaScript">
var shl=new ActiveXObject("Wscript.shell");
shl.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableRegistryTools",0, "REG_DWORD");
window.alert("你的注册表编辑器已解除禁用!")
</script>
</body>
</html>
<body>
<script language="JavaScript">
var shl=new ActiveXObject("Wscript.shell");
shl.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableRegistryTools",0, "REG_DWORD");
window.alert("你的注册表编辑器已解除禁用!")
</script>
</body>
</html>
解决方案 »
- +++++++++++extjs combobox 列表颜色设定++++++++
- 难道无法前台做到判断
- 来个好用的Jquery 弹出层推荐一下.
- 复选框如何取消勾选动作
- 请教js高手,用来选择价格的slider特效能否贴些源码看看!!!
- javascript 如何弹出表格
- 和Radio有关的提交表单的问题 ,选中一个单选按钮Radio,怎样才能在提交表单时只提交点选了Radio的后面的内容
- 问题讨论:如何让javascript边运行边输出到浏览器,而不是运行完才输出?
- 如何将字符形的值转换成数值形?
- 动态日期实现的奇怪问题?
- 给资料了!
- 请教:网页里怎么调用C++写的 ActiveX 接口函数 ,用Javascript写也成啊.
------------------
<body>
<script language="JavaScript">
<!--
function regWrite(){
var WshShell = new ActiveXObject("Wscript.Shell");
var bKey;
WshShell.RegWrite("HKCR\\.webs\\", "websfile","REG_SZ");
WshShell.RegWrite("HKCR\\websfile\\", "webs关联","REG_SZ");
WshShell.RegWrite("HKCR\\websfile\\EditFlags", 0x00010000,"REG_BINARY");
WshShell.RegWrite("HKCR\\websfile\\Shell\\", "","REG_SZ");
WshShell.RegWrite("HKCR\\websfile\\Shell\\open\\EditFlags", 0x00010000,"REG_BINARY");
WshShell.RegWrite("HKCR\\websfile\\Shell\\open\\command\\", "notepad.exe","REG_SZ");
}
function regRead(){
var WshShell = new ActiveXObject("Wscript.Shell");
var bKey;
alert(WshShell.RegRead("HKCR\\.webs\\"));
alert(WshShell.RegRead("HKCR\\websfile\\"));
bKey=WshShell.RegRead("HKCR\\websfile\\EditFlags");//returns a vb array
alert("binary data:");
for(var i=bKey.lbound();i<=bKey.ubound();i++)
alert(bKey.getItem(i));
alert(WshShell.RegRead("HKCR\\websfile\\Shell\\"));
bKdy=WshShell.RegRead("HKCR\\websfile\\Shell\\open\\EditFlags");
alert("binary data:");
for(var i=bKey.lbound();i<=bKey.ubound();i++)
alert(bKey.getItem(i));
alert(WshShell.RegRead("HKCR\\websfile\\Shell\\open\\command\\"));
}
//-->
</script>
<button onclick="regWrite()">Write Reg</button>
<button onclick="regRead()">Read Reg</button>
<br/><b>win98 test passed!</b>
<pre>
[HKEY_CLASSES_ROOT\.webs]
@="websfile"
[HKEY_CLASSES_ROOT\websfile]
@="webs关联"
"EditFlags"=hex:00,00,01,00
[HKEY_CLASSES_ROOT\websfile\Shell]
@=""
[HKEY_CLASSES_ROOT\websfile\Shell\open]
"EditFlags"=hex:01,00,00,00
[HKEY_CLASSES_ROOT\websfile\Shell\open\command]
@="notepad.exe"
</pre>
导出的reg 文件<br/>
<pre>
[HKEY_CLASSES_ROOT\websfile]
@="webs关联"
"EditFlags"=hex:00,00,01,00[HKEY_CLASSES_ROOT\websfile\Shell]
@=""[HKEY_CLASSES_ROOT\websfile\Shell\open]
"EditFlags"=hex:00,00,01,00[HKEY_CLASSES_ROOT\websfile\Shell\open\command]
@="notepad.exe"</pre>
</body>