Click to See Complete Forum and Search --> : Can I call exe from Javascript


sl388
12-29-2003, 04:03 AM
Anyone know if it is possible for me to call an exe file from Javascript? The exe file is just a command prompt based program, not a windows program. Any idea? ..Simon

AdamGundry
12-29-2003, 04:23 AM
You cannot, due to built in security features. The best you can do is start a download, and the user will get the standard "do you wish to download or open this file" box. Any workaround is a _serious_ security flaw.

Adam

TheBearMay
12-29-2003, 07:42 AM
A purely IE implementation and one that may require some lowering of security levels:


function run(file) {
var ws = new ActiveXObject("WScript.Shell");
ws.run(file);
}
...
...onclick='run("file:///C:/Program%20Files/My%20Directory/Test.exe")'...

turok101
08-19-2009, 06:10 AM
I'm using an IBM Mashups software which only supports XML and Javascript. I have no background in either, but I need to know exactly how to do the following. I'm trying to forward data upon user request from Mashups to a C++ file, which I successfully achieved. The only problem is I need the process to be click activated. So i need a complete block of code which will just receive a click, on a button for example, and it will automatically run the C++ file, be it .cpp or .exe, which ever.

I imagine it'll look something like the line you wrote below

"onclick='run("file:///C:/Program%20Files/My%20Directory/Test.exe")'"

Appreciate all your efforts

P.S. just noticed it's like 6 years ago since the thread ended :S