I am new to stack overflow. Currently we're facing a challenge to of launching an external program from our Webapp. We're open for suggestions. What we're looking is following Run shell script or batch file or exe or jar from a webapp using all browsers. For webapp we use plain Javascript and Polymer web components. Also, we can not use jQuery. Can node.js will be helpful in this situation, I am aware of child process library in node.js. Also, is there any other way to achieve this? Your help will be much appreciated.
-
Are you trying to launch a program on the client computer from the browser? There aren't really direct ways of doing this as it presents a number of security issues: http://unix.stackexchange.com/questions/211118/execute-a-shell-command-upon-a-click-event-in-a-web-page – upcrob Dec 18 '15 at 16:30
-
If you're looking to run something on the server side, I imagine you'd want to look into something like this (disclaimer: I know nearly nothing about NodeJS): http://stackoverflow.com/questions/5775088/is-it-possible-to-execute-an-external-program-from-within-node-js – upcrob Dec 18 '15 at 16:31
1 Answers
It's not clear if you're willing to start a process on the client or on the server. If on the server, it's quite easy, and whatever server-side technology you use will probably expose a way for you to spawn a process.
However if you're willing to do so on the client-side, there isn't a native way to do it (Imagine the security repercussions of such a feature). The server-side technology isn't of any help for this approach, and you have a few possible workarounds.
One possible approach would be to develop an extension for all major browsers (Extensions for Firefox / Chrome, ActiveX for IE).
In my knowledge, a good example of such approach is implemented by many gaming launchers. For instance Origin has a Firefox extension allowing to start the game from their website directly, which will in turn start the native game on the client's computer.

- 869
- 5
- 18