1

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.

Felix Kling
820k181 gold badges1.1k silver badges1.2k bronze badges
asked Aug 2, 2011 at 12:52
5
  • Code: Indent with four spaces. Bold: **Bold**. Line break: Two spaces at the end if the line. stackoverflow.com/markdown 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. Commented Aug 2, 2011 at 12:56
  • have a look at the below link stackoverflow.com/questions/4499556/… 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 computer connecting on my website using echo, run it and control all my visitors pcs... 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 Commented Aug 2, 2011 at 13:10

4 Answers 4

6

You cannot use ActiveX commands from Firefox. See more here: http://support.mozilla.com/en-US/kb/activex And you cannot launch an application using Javascript. Maybe with a Java Applet, or something.

answered Aug 2, 2011 at 12:54
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for the reply. Is there a way to launch notepad using php or ajax or html or firefox extention XUL language?
I don't think there's any possibility. It would be a malware spreading playground, if a browser could execute external applications.
@Sangam254 Most plugins/addons (XUL apps, ActiveX, NPAPI plugin) when installed by the user could do it. But without an install it isn't possible.
1

You can't - browser security prohibits it from linking with the file-system or other applications on a users machine.

http://support.mozilla.com/en-US/kb/ActiveX

answered Aug 2, 2011 at 12:56

Comments

0

Needs a NPAPI plugin. Check This out.

answered Aug 2, 2011 at 12:56

Comments

0

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.

answered Aug 2, 2011 at 13:40

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.