Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

permission denied with shell.application

Tags:

javascript

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?

like image 448
jitendra Avatar asked Dec 21 '10 06:12

jitendra


1 Answers

It's necessary to have two settings turned on.

  1. Enable unsigned ActiveX controls for the current zone
    Tools > Internet Options > Security > Custom level...
    Enable "ActiveX Controls and plug-ins" > "Initialize and script ActiveX controls not marked as safe for scripting"

  2. Allow Active Content to run files
    Tools > Internet Options > Advanced > Security Enable "Allow Active Content to run in files on My Computer"

    ** Make sure to close all your IE browser windows.
like image 145
caspian Avatar answered Sep 20 '22 00:09

caspian