How to run a local program in a webpage using javascript.
This example describes how to run a local program on a webpage using javascript. We will share this with you for your reference. The details are as follows:
<Input onclick = "exec('notepad.exe ')" value = "execute noteppad.exe" type = "button"> <input onclick = "exec('cmd.exe ') "value =" execute cmd.exe "type =" button "> <script language =" javascript "> function exec (command) {window. oldOnError = window. onerror; window. _ command = command; window. onerror = function (err) {if (err. indexOf ('utomation ')! =-1) {alert ('COMMAND '+ window. _ command +' has been disabled by the user! '); Return true;} Else return false;}; // ----------- // var wsh = new ActiveXObject ('wscript. shell '); if (wsh) wsh. run (command); wsh = null; window. onerror = window. oldOnError ;}</script>