1

Javaスクリプトを使用して、Apacheサーバーに存在するbatファイルを実行しようとしています。「オートメーション サーバーはオブジェクトを作成できません」というエラーが表示されます。以下のコードを見つけて、問題の解決方法をお知らせください。

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script>    
    function testing() {
        alert("Execution will start");
        WshShell = new ActiveXObject("WScript.Shell");
        alert("after webShell");
        //var commandtoRun = "C:\\Program Files\\Apache Group\\Apache2\\htdocs\\application\\gui\\templates\\execute\\test.bat";

        WshShell.Run ("\"C:\\Program Files\\Apache Group\\Apache2\\htdocs\\application\\gui\\templates\\execute\\test.bat\"");

        alert("after webShell");

    }

    </script>

</head>


    enter code here
    <body> 

    <form>

    <p id="demo">Running scripts </p>
    <input type="button" onclick="javascript: testing ();" value="Run Scripts" />
    <button onclick="javascript: testing ();">Run bat File</button>

    </form>
    </body>

    </html>
4

1 に答える 1