0

I want to launch a exe file when click on the button from my appliction and that should be from client machine. I tried with following solutions. Runtime.getRuntime().exec(".....\\somefile.exe");

when I follows the above solution then it was opened server machine exe file. I applied one more solution in script code i.e

**var ws = new ActiveXObject("WScript.Shell");
ws.Exec("...\\somefile.exe");**

the above code working fine but I need to enable ActiveX related script enble mode in client browser window manually and it is only applied for IE only. Let me know any solution that is browser independent and without activex enable option.

Div
  • 28
  • 1
  • 4
    I'm not saying this isn't possible, but it is really bad practice. You should take some time and think about if you really NEED to do this. – Kevin Jun 05 '13 at 13:36
  • 1
    If you can run a setup on the client machine this can be accomplished in IE, FF & Chrome quite easily with a custom protocol handler "location.href='myapp://run'" (http://stackoverflow.com/questions/80650/how-do-i-register-a-custom-url-protocol-in-windows) not sure about Opera. – Alex K. Jun 05 '13 at 13:39
  • Every Hacker out there wants this too! – epascarello Jun 05 '13 at 13:41
  • But I have to launch a installed file (exe file) when user clicks on a button. I didn't get other than this solution. – Div Jun 05 '13 at 13:43
  • Most of the browsers won't allow this directly. In chrome you can't even open a downloaded .exe file directly :) – codeVerine Jun 05 '13 at 13:48
  • sounds like a hack !! – anshulkatta Jun 05 '13 at 14:10
  • If this worked (so easily), it would pose a major security threat! Whatever makes you want to do this: Better find another way. – Fildor Jun 05 '13 at 15:24

0 Answers0