以 javascript 執行 exe 檔
使用 javascript 呼叫 client 端可執行的 exe 檔
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <script type="text/javascript"> <!-- //var executableFullPath = 'F:\ZK\DownLoadFile\YodaoDict.exe'; var executableFullPath = 'notepad.exe d:\test.htm'; try { var shellActiveXObject = new ActiveXObject("WScript.Shell"); if ( !shellActiveXObject ) { alert('Could not get reference to WScript.Shell'); } shellActiveXObject.Run(executableFullPath, 1, false); shellActiveXObject = null; } catch (errorObject) { alert('Error:n' + errorObject.message); } // --> </script> |