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 =)

3
  • 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. Commented May 17, 2013 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. Commented May 17, 2013 at 11:30
  • It's not for a browser =) Commented May 17, 2013 at 12:43

1 Answer 1

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;

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.