0

I just want to open a notepade.exe using html Js ,I tried this code but its not working Can any one help me over this. This file is run.html !!!

<html>
  <head>
   <script>
    alert("hi");
    <!-- myWindow.close();   -->
    var param1var = window.location.search.replace( "?", "" );
    alert(param1var);
    var oShell = new ActiveXObject("Shell.Application");
    var commandtoRun = "C:\\Windows\\notepad.exe"; 
    oShell.ShellExecute(commandtoRun,"","","open","1");
    window.close()
   </script>
  </head>
</html>
Barmar
  • 741,623
  • 53
  • 500
  • 612

1 Answers1

2

Open Internet Explorer and change / enable these two settings

Tools > Internet Options > Security > Custom level > ActiveX Controls and plug-ins > Initialize and script ActiveX controls not marked as safe for scripting

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

Just in case, restart Internet Explorer

hex494D49
  • 9,109
  • 3
  • 38
  • 47