我使用此代码:
<script>
function LaunchApp() {
if (!document.all) {
alert("Available only with Internet Explorer.");
return;
}
var ws = new ActiveXObject("WScript.Shell");
ws.Exec("C:\\Windows\\notepad.exe");
}
<a href="javascript:LaunchApp()">Launch the executable</a>
但这不起作用。 (链接已禁用)
答案 0 :(得分:2)
您没有指向相同的JavaScript函数。试试这个:
<button onclick="LaunchApp()">Run Exe File</button>
您的互联网设置必须设置为最低安全级别才能运行此类代码。