How to config IE to make “wscript.shell” work

前端 未结 3 773
心在旅途
心在旅途 2020-12-03 13:00

I have some code that used to work. But I today when I try it again. I kept got \"[object error]\".

I thought it\'s the problem of IE safety configure. But I can

相关标签:
3条回答
  • 2020-12-03 13:05

    It may be necessary to make a change to the IE settings:

    For example, for the Local intranet zone, you typically need to change a custom setting to "Initialize and script ActiveX controls not marked as safe for scripting."

    I couldn't get the sample above to run without making the change.

    0 讨论(0)
  • 2020-12-03 13:12

    You must enable ActiveX:

    • Click on Tools
    • Select Internet Options...
    • Select Security tab.
    • Select Internet in Web content zone.
    • Then, click on Custom Level...
    • Go through all the ActiveX setting there, select Prompt or Enable
    0 讨论(0)
  • 2020-12-03 13:15

    it is Case Sensitive !!

    <html>
    <head>
    <script language="javascript" type="text/javascript">
    function OpenFile(){
    alert ('Work');
    var x = new ActiveXObject("WScript.Shell");
    x.run('calc.exe');
    }
    </script>
    </head>
    
    <body>
    
    <input  type="button" value="GG"  href="#" onclick="javascript:OpenFile();">
    </body>
    </html>
    
    0 讨论(0)
提交回复
热议问题