0

i use this script for run application on client side

function RunEXE(prog) {
    var oShell = new ActiveXObject("WScript.Shell");
    oShell.Run('"' + prog + '"', 1);
} 
RunEXE('1.exe'); 

this code worked on IE but in Firefox does not worked for ActiveXObject.

Question what is equivalent of this code for Firefox? or

how can convert this code for firefox?

what is equivalent of ActiveXobject in firefox?

how can user WScript.Shell in firefox?

no matter i can change all permission on client side browser

mhkyazd
  • 285
  • 5
  • 17
  • 3
    You don't. A browser does not have the right to run executables. Your code does not work in recent versions of IE unless you change permission settings to be wide open for all kinds of attacks – Ruan Mendes May 13 '15 at 03:33
  • 1
    [This](http://stackoverflow.com/questions/7022568/activexobject-in-firefox-or-chrome-not-ie) might help – R. Schifini May 13 '15 at 03:33
  • @Juan Mendes no matter i can change all permission on client side browser – mhkyazd May 13 '15 at 03:41
  • 1
    http://stackoverflow.com/questions/2490713/how-to-run-a-local-exe-in-my-firefox-extension?rq=1 – Thilo May 13 '15 at 03:45

1 Answers1

1

My suggestion is that you create an applet and run code like the following:

Runtime.getRuntime().exec("file.exe", null, new File("."));

If you want to be able to pass arguments to the java applet, you'll have to learn about communication between JavaScript and Java in applets. See https://docs.oracle.com/javase/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html

This is totally untested, and you may have to get your applet signed and deal with SecurityManager https://docs.oracle.com/javase/tutorial/essential/environment/security.html

Ruan Mendes
  • 90,375
  • 31
  • 153
  • 217
  • i try use applet but ;( ;( http://stackoverflow.com/questions/29966200/access-denied-java-io-filepermission-execute and http://stackoverflow.com/questions/29962645/how-can-import-package – mhkyazd May 13 '15 at 04:14
  • very bad security manager and JNLP ,i hate, i spend one week for this. – mhkyazd May 13 '15 at 04:17