I want to launch an application eg. notepad or MSword on click of a button using javascript function. I have tried ActiveXObject meant for IE.
function runApp()
{
var shell = new ActiveXObject("WScript.shell");
shell.run("notepad.exe", 1, True);
}
I need a solution which supports Firefox.
Please suggest.
Thanks in advance.
I want to launch an application eg. notepad or MSword on click of a button using javascript function. I have tried ActiveXObject meant for IE.
function runApp()
{
var shell = new ActiveXObject("WScript.shell");
shell.run("notepad.exe", 1, True);
}
I need a solution which supports Firefox.
Please suggest.
Thanks in advance.
-
Code
: Indent with four spaces. Bold:**Bold**
. Line break: Two spaces at the end if the line. stackoverflow./markdown – Felix Kling Commented Aug 2, 2011 at 12:54 - 1 You're not supposed to be able to do this. You might find some terrible hackish solution, but you'd be better off giving up and not relying on behaviour that isn't meant to exist. – user229044 ♦ Commented Aug 2, 2011 at 12:56
- have a look at the below link stackoverflow./questions/4499556/… – Massimiliano Peluso Commented Aug 2, 2011 at 12:56
- Me too i want such feature from any browser, then i'll create a remote shell on any puter connecting on my website using echo, run it and control all my visitors pcs... – Julien Roncaglia Commented Aug 2, 2011 at 12:58
- @Sangam254 why would a website possibly want to open up word for me? This is ridiculious. Dont do this – Raynos Commented Aug 2, 2011 at 13:10
4 Answers
Reset to default 6You cannot use ActiveX mands from Firefox. See more here: http://support.mozilla./en-US/kb/activex And you cannot launch an application using Javascript. Maybe with a Java Applet, or something.
You can't - browser security prohibits it from linking with the file-system or other applications on a users machine.
http://support.mozilla./en-US/kb/ActiveX
Needs a NPAPI plugin. Check This out.
The best thing I can think off is serving a file which would be linked to open in the application concerned. So if you serve a .doc file the user would generally open it in Word.. assuming Word is installed and configured that way.. there is no way to guarantee this.
But you can't then interact with the application directly from the browser - as others have pointed out this would be a malware nightmare if possible.