简体   繁体   中英

Executing .EXE file from Browser

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>

No, 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.com/extensions/api_index Internet Explorer: http://msdn.microsoft.com/en-us/library/ie/hh828809(v=vs.85).aspx Safari: https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/Introduction/Introduction.html Firefox: https://addons.mozilla.org/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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM