admin管理员组文章数量:1332881
Hi i am using ActiveXObject to execute an exe file but it is working in only IE. IS there any thing that works in all browsers.
<script>
function LaunchApp() {
if (!document.all) {
alert ("Available only with Internet Explorer.");
return;
}
var ws = new ActiveXObject("WScript.Shell");
ws.Exec("C:\\Program Files\\Xyz.exe");
}
</script>
Hi i am using ActiveXObject to execute an exe file but it is working in only IE. IS there any thing that works in all browsers.
<script>
function LaunchApp() {
if (!document.all) {
alert ("Available only with Internet Explorer.");
return;
}
var ws = new ActiveXObject("WScript.Shell");
ws.Exec("C:\\Program Files\\Xyz.exe");
}
</script>
Share
Improve this question
asked Oct 7, 2013 at 12:37
DharmDharm
872 silver badges11 bronze badges
2
- Dare I ask, what kind of an .exe you are trying to run? How did this .exe get on the clients puter? – James A Mohler Commented Oct 7, 2013 at 14:21
- ya i want to execute an exe that changes the volume settings of the client system it gets downloaded on the client system with our application. – Dharm Commented Oct 7, 2013 at 15:12
4 Answers
Reset to default 8No, that is a huge security risk. Plus, it would not work on Macs or Linux machines.
Sorry to be brutal but I suggest you abandon all work on ActiveX now and consign it to the bin.
ActiveX is a piece of history that dates back to a time when Microsoft thought they ruled the world, thankfully nobody believes that any more, not even Microsoft.
Why not create a browser plugin for all browsers? Then it would be sand-boxed and have less potential risk for tanking the user's system. You never want to let JavaScript arbitrarily run code on a user's system. I'm sure that most anti-virus programs would detect this sort of behavior as malware or a sort of virus.
Take a look at Kango or FireBreath for cross-browser plugin development frameworks.
All the browsers have their own development APIs.
Chrome: https://developer.chrome./extensions/api_index Internet Explorer: http://msdn.microsoft./en-us/library/ie/hh828809(v=vs.85).aspx Safari: https://developer.apple./library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/Introduction/Introduction.html Firefox: https://addons.mozilla/en-US/developers/docs/reference
You will need to see which browser allows you the features you want. Not all browsers work the same way and that means you may have to write different functions for different browsers.
As for Skype. The application is installed on the users machine - the extension probably just reads the configuration file for what hardware is attached.
本文标签: javascriptExecuting EXE file from BrowserStack Overflow
版权声明:本文标题:javascript - Executing .EXE file from Browser - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742297406a2449009.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论