1

I'm making an application for D-bus in javascript. I need to call an executable from the javascript code and I know that it's possible to do it in Windows like this

var activeXObj = new ActiveXObject("Shell.Application"); 
activeXObj.ShellExecute("C:\\WINDOWS\\NOTEPAD.EXE", "", "", "open", "1");

But...how to do the same in Linux??

Thanks a lot

P.S: Is not for a browser =)

user2390061
  • 13
  • 1
  • 5
  • There is no way. Browsers (maybe except IE) are designed not to touch the user's machine for security reasons. Plugins could do it, but with limited reach also. – Joseph May 17 '13 at 11:25
  • From the original question I'm not sure the script is really intended to be used inside a browser. I am sure however that it cannot be done with activex on linux. – Axel May 17 '13 at 11:30
  • It's not for a browser =) – user2390061 May 17 '13 at 12:43

1 Answers1

1

Install node.js (depending on your distro, sudo apt-get install nodejs) and use the ChildProcess module to execute the program.

Or, get Rhino and use the runCommand command;

glenn jackman
  • 238,783
  • 38
  • 220
  • 352