当前位置:Gxlcms > JavaScript > html中使用javascript调用本地程序(exe、doc等)实现代码

html中使用javascript调用本地程序(exe、doc等)实现代码

时间:2021-07-01 10:21:17 帮助过:7人阅读

第一次用到这个,做个记录,在html页面中调用本地程序:
代码如下:

<html>
<head>
<script language="javascript">
function Run(strPath)
{
var objShell = new ActiveXObject("wscript.shell");
objShell.exec(strPath);
objShell = null;
}
</script>
</head>
<body>
请输入要运行的程序路径:<br>
<input name=exe type=text size=20 value="D:\\a.doc">
<BUTTON class=button onclick="Run(exe.value)">确定</BUTTON>
</body>
</html>

人气教程排行