Reputation: 1616
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.
Upvotes: 1
Views: 18088
Reputation: 207537
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.
Upvotes: 1