最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Automation Server can't create object in IE8 after including condition for chrome - Stack Overflow

programmeradmin3浏览0评论

Previously i was doing

    <script>
    function fun1(){
       var sh=new ActiveXObject("Wscript.Shell");
       sh.run("\\\\ntbot\\my.exe");
    }
    fun();
    </script>

there is no problem with this code. it happily execute exe on client machine from IE, to run same from chrome i written applet, and from that i am runing exe. so code changes i done are

<scipt>
    function testCSS(prop) {
        return prop in document.documentElement.style;
    }
     var isChrome = !!(window.chrome && chrome.webstore && chrome.webstore.install);
     var isIE = /*@cc_on!@*/false || testCSS('msTransform'); 


        function fun2(isIE,isChrome)
        {
            if(isIE){
                var sh=new ActiveXObject("Wscript.Shell");
                sh.Run("\\\\ntbot\\my.exe");
                }if(isChrome){
                appletsource="<APPLET archive='CalciApplet.jar' codebase='/kiss' CODE='AppletGchrome.CalculateApplet.class' WIDTH='0' HEIGHT='0'></APPLET>"
                document.getElementById("appletplace").innerHTML=appletsource;
            }
        }

        fun2(isIE,isChrome);
</script>

not its working on Chrome, but not in IE in IE i am getting Automation Server can't create object. error

plz help me in this.. thank you.

Regards, swapnil P.

Previously i was doing

    <script>
    function fun1(){
       var sh=new ActiveXObject("Wscript.Shell");
       sh.run("\\\\ntbot\\my.exe");
    }
    fun();
    </script>

there is no problem with this code. it happily execute exe on client machine from IE, to run same from chrome i written applet, and from that i am runing exe. so code changes i done are

<scipt>
    function testCSS(prop) {
        return prop in document.documentElement.style;
    }
     var isChrome = !!(window.chrome && chrome.webstore && chrome.webstore.install);
     var isIE = /*@cc_on!@*/false || testCSS('msTransform'); 


        function fun2(isIE,isChrome)
        {
            if(isIE){
                var sh=new ActiveXObject("Wscript.Shell");
                sh.Run("\\\\ntbot\\my.exe");
                }if(isChrome){
                appletsource="<APPLET archive='CalciApplet.jar' codebase='/kiss' CODE='AppletGchrome.CalculateApplet.class' WIDTH='0' HEIGHT='0'></APPLET>"
                document.getElementById("appletplace").innerHTML=appletsource;
            }
        }

        fun2(isIE,isChrome);
</script>

not its working on Chrome, but not in IE in IE i am getting Automation Server can't create object. error

plz help me in this.. thank you.

Regards, swapnil P.

Share Improve this question asked Feb 27, 2013 at 12:49 swapyswapy 1,6161 gold badge15 silver badges32 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 1

ActiveX is IE Only! It will never work on Chrome.

Automation Server can't create object means the security settings for activeX are set at the wrong level. Add your page to trusted sites.

发布评论

评论列表(0)

  1. 暂无评论