js调用本地 exe
function Run(strPath) //only for ie { try { var objShell = new ActiveXObject("wscript.shell"); objShell.CurrentDirectory="E:\\YOURPATH\\C++\\CHelloWord 3\\Debug\\"; //设置当前路径很重要,能让exe程序解决 相对路径问题 (否则会在html所在路径找) objShell.Run(strPath); objShell = null; } catch(e){ alert(e.message); } }
<a href="#" onclick="Run('CHelloWord3.exe')">RUN EXE</a>
作者:RichardCui
出处:https://www.cnblogs.com/yachao1120/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。该文章也同时发布在我的独立博客中-RichardCuiBlog。