简体   繁体   中英

I can't open an exe using Javascript

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>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM