[英]permission denied with shell.application
I have following javascript code to run notepade.exe:我有以下 javascript 代码来运行 notepade.exe:
<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
function executeCommands()
{
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun ="C:\WINDOWS\notepad.exe";
oShell.ShellExecute(commandtoRun,"","", "open", "1");
}
</SCRIPT>
The problem is that, when i run the script then it give error..."Permission denied."问题是,当我运行脚本时,它会给出错误...“权限被拒绝。”
Can anybody help me on this matter?有人可以帮我解决这个问题吗?
It's necessary to have two settings turned on.有必要打开两个设置。
You may experience a "Permission denied" error, which means that the browser will not let script execute outside the "sandbox".您可能会遇到“权限被拒绝”错误,这意味着浏览器不会让脚本在“沙箱”之外执行。 Try solving the issue by changing a security setting in the browser:
尝试通过更改浏览器中的安全设置来解决问题:
The above is for IE, but most browsers have similar options.以上是针对 IE 的,但大多数浏览器都有类似的选项。
Okay, weirdly, I had this issue when running a.html file I'd created on my desktop into IE... but when I moved the file onto a WAMPServer it worked okay;好吧,奇怪的是,我在将我在桌面上创建的 .html 文件运行到 IE 时遇到了这个问题......但是当我将文件移动到 WAMPServer 时它工作正常; Not quite sure why that should solve the problem, but maybe that'll help someone??
不太确定为什么要解决问题,但也许这会对某人有所帮助?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.