Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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
otepad.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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
275 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...