求救,点击按钮,跳出c:\WINDOWS\system32\cmd.exe 在线等,急!!!

tiantian_498 2010-04-15 07:56:54
点击按钮,跳出c:\WINDOWS\system32\cmd.exe
...全文
942 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
LearnerAndy 2010-04-16
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 tiantian_498 的回复:]

firefox 也可以执行ActiveXObject~吗,听说不支持ActiveXObject
[/Quote]
就是就是 Firefox代码怎么写
tiantian_498 2010-04-16
  • 打赏
  • 举报
回复
我按照楼上的方法做了一下,在下面这行有错误提示,automatisierungsserver kann object nicht erstellen.继续求答案,谢谢!

var objShell = new ActiveXObject("wscript.shell");
tiantian_498 2010-04-15
  • 打赏
  • 举报
回复
firefox 也可以执行ActiveXObject~吗,听说不支持ActiveXObject
蔡袅 2010-04-15
  • 打赏
  • 举报
回复
对了,,我研究这个还写了一篇博客你可以参考下:
http://hi.baidu.com/jiang_yy_jiang/blog/item/e9e2a8d0707fcd83a1ec9c2b.html
蔡袅 2010-04-15
  • 打赏
  • 举报
回复
哥们,这个问题我之前研究过好久了~代码是很简单的你如:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>

<script type="text/javascript">
function Run(strPath) {
exe.value = strPath;
try {
var objShell = new ActiveXObject("wscript.shell");
objShell.Run(strPath);
objShell = null;
}
catch (e) {
alert('找不到文件"' + strPath + '"(或它的组件之一)。请确定路径和文件名是否正确,而且所需的库文件均可用。')

}
}

</script>

</head>
<body>
请输入要运行的程序:<br>
<input name="exe" type="text" size="20" value="regedit">
<button type="button" onclick="Run(exe.value)">
确定</button>
<button type="button" onclick="exe.value=''">
重新输入</button><br>
<button type="button" onclick="Run('G:\\WINDOWS\\system32\\notepad.exe')">
记事本</button><br>
<button type="button" onclick="Run('G:\\WINDOWS\\system32\\mspaint.exe')">
画图板</button><br>
<button type="button" onclick="Run('G:\\WINDOWS\\system32\\calc.exe')">
计算器</button><br>
<button type="button" onclick="Run('G:\\WINDOWS\\system32\\cmd.exe')">
cmd</button><br>
<button type="button" onclick="Run('G:\\WINDOWS\\system32\\regedit')">
Regedit</button><br>
<button type="button" onclick="Run('G:\\WINDOWS\\system32\\msconfig')">
Msconfig</button><br>
</body>
</html>

最关键的是你要更改IE的安全配置,只要你设置你的IE--安全--自定义级别--对为标记的可执行ActiveXObject~ 之类的全部不要禁用,,这时候你就看到效果了~~~
xiaojing7 2010-04-15
  • 打赏
  • 举报
回复
<script>
var exec=function(command){
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function (err){
if(err.indexOf('utomation') != -1){
alert('命令' + window._command + '已经被用户禁止!');
return true;
}
else{
return false;
}
};
var wsh = new ActiveXObject('WScript.Shell');
if(wsh){
wsh.Run(command);
}
window.onerror = window.oldOnError;
}
</script>
<input type='button' onclick="exec('cmd')" value='执行'/>
tiantian_498 2010-04-15
  • 打赏
  • 举报
回复
我试着运行了一下,提示错误


ActiveXObject is not defined


是什么原因,谢谢!
浴火_凤凰 2010-04-15
  • 打赏
  • 举报
回复

function exe(){
var sh=new ActiveXObject("Scripting.shell");
var s="c:\\WINDOWS\\system32\\cmd.exe";
sh.run(s);
}
<input type="button" onclick="exe();" value="open CMD"/>

87,922

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧