-1

i use this code:

<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> 

but this not work. (Link is disabled)

4

1 に答える 1

2
  1. 同じ JavaScript 関数を指していません。これを試して:

    <button onclick="LaunchApp()">Run Exe File</button>

  2. この種のコードを実行できるようにするには、インターネット設定を可能な限り低いセキュリティ レベルに設定する必要があります。

于 2012-12-09T21:43:24.403 に答える