方法1:
function runExecutable()
{
var executableFullPath=document.getElementById("path").value;
try {
var shellActiveXObject = new ActiveXObject("WScript.Shell");
if ( !shellActiveXObject )
{
alert('Could not get reference to WScript.Shell');
return;
}
shellActiveXObject.Run(executableFullPath, 1, false);
shellActiveXObject = null;
}
catch (errorObject)
{
alert('Error:\n' + errorObject.message);
}
}
只可以用IE浏览器打开,并且需要在工具安全中设置可使用ActiveXObject控件
方法2:利用html、angularjs和Python,在Python文件中引用import os,调用其中os.startfile(路径)方法,就可以打开本地文件了
对应的程序可能链接不一样,可参考http://blog.csdn.net/zssureqh/article/details/25828683这个网址。