为什么var wsh=new ActiveXObject("WScript.Shell");不成功?(在线解决就送分)
var wsh=new ActiveXObject("WScript.Shell");
运行页面时,调用这句话时出现如下错误:
错误:找不到指定的程序。
调试时运行到这句话时弹出对话框说:未知的异常
windows 2000 pro,IIS 5.0,IE6.0
问题点数:50、回复次数:13Top
1 楼cooldht(╆编编╇)回复于 2002-12-24 09:12:03 得分 0
UPTop
2 楼saucer(思归)回复于 2002-12-24 09:35:00 得分 10
are you sure "错误:找不到指定的程序" is caused by this line or the run() method? if it is the latter, make sure the path is correct
are you running it on the client side? lower the ActiveX security settingsTop
3 楼qiushuiwuhen(秋水无恨)回复于 2002-12-24 09:41:03 得分 10
要注意几点:
1.run不支持长文件名
2.还有\在js中要写成\\Top
4 楼cooldht(╆编编╇)回复于 2002-12-24 10:13:53 得分 0
我已经将ActiveX security 降到最低。
有一段代码
直接在资源管理器用IE打开,没错,弹出记事本窗口
但在IIS中运行就出错,错误:你没有权限
<html>
<script language="javascript">
<!--
function RunCmd()
{
var shl=new ActiveXObject("Shell.Application");
//shl.Run("notepad.exe");
shl.ShellExecute("notepad.exe");
}
//-->
</script>
<body onload="RunCmd();">
</body>
</html>Top
5 楼saucer(思归)回复于 2002-12-25 00:38:09 得分 10
enable the ActiveX security setttings for the zone where your IIS is in, "Initialize and script ActiveX controls not marked as safe" in particular
for example, if the IIS is on your machine, change the settings for Local Intranet. If the IIS is on the internet, change the settings for InternetTop
6 楼cooldht(╆编编╇)回复于 2002-12-25 09:18:07 得分 0
saucer:
I did as you said above!
In my owen computer(IE6.0) ,error:
but in other computer at the Intranet(IE6.0) ,succeed!
Top
7 楼cooldht(╆编编╇)回复于 2002-12-25 09:22:59 得分 0
the error is:"错误:没有权限Top
8 楼cooldht(╆编编╇)回复于 2002-12-25 09:33:14 得分 0
I make a mistake when I set ActiveX security!
Thank You a Lot!Top
9 楼denghaitao()回复于 2002-12-25 09:38:05 得分 0
UP
Top
10 楼denghaitao()回复于 2002-12-25 09:39:08 得分 5
But when I use
var wsh=new ActiveXObject("WScript.shell");
error:错误:Automation 服务器不能创建对象Top
11 楼saucer(思归)回复于 2002-12-25 09:50:07 得分 10
change the security settings for that zone or add the site to your Trusted Sites in Tools->Internet Options->SecurityTop
12 楼online(龙卷风V4.0--决战江湖(MS MVP-VB))回复于 2002-12-25 18:05:58 得分 5
安装wsh6.5Top
13 楼cooldht(╆编编╇)回复于 2002-12-31 11:32:26 得分 0
正如思归所说!Top




