Reputation: 577
I have following javascript code to run 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?
Upvotes: 7
Views: 14869
Reputation: 1
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; Not quite sure why that should solve the problem, but maybe that'll help someone!?
Upvotes: 0
Reputation: 1804
It's necessary to have two settings turned on.
Upvotes: 10
Reputation: 1768
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.
Upvotes: 1