are you sure "错误:找不到指定的程序" is caused by this line or the run() method? if it is the latter, make sure the path is correctare you running it on the client side? lower the ActiveX security settings
enable the ActiveX security setttings for the zone where your IIS is in, "Initialize and script ActiveX controls not ed as safe" in particularfor 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 Internet
saucer: I did as you said above! In my owen computer(IE6.0) ,error: but in other computer at the Intranet(IE6.0) ,succeed!
the error is:"错误:没有权限
I make a mistake when I set ActiveX security! Thank You a Lot!
But when I use var wsh=new ActiveXObject("WScript.shell"); error:错误:Automation 服务器不能创建对象
change the security settings for that zone or add the site to your Trusted Sites in Tools->Internet Options->Security
1.run不支持长文件名
2.还有\在js中要写成\\
有一段代码
直接在资源管理器用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>
I did as you said above!
In my owen computer(IE6.0) ,error:
but in other computer at the Intranet(IE6.0) ,succeed!
Thank You a Lot!
var wsh=new ActiveXObject("WScript.shell");
error:错误:Automation 服务器不能创建对象