Dharm
Dharm

Reputation: 87

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>

Upvotes: 0

Views: 2911

Answers (4)

Dave Gordon
Dave Gordon

Reputation: 1835

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.

Upvotes: 0

Cameron Tinker
Cameron Tinker

Reputation: 9789

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.

Upvotes: 1

user835745
user835745

Reputation: 1984

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.

Upvotes: 2

Daniel A. White
Daniel A. White

Reputation: 191037

No, that is a huge security risk. Plus, it would not work on Macs or Linux machines.

Upvotes: 8

Related Questions