user2390061
user2390061

Reputation: 13

How to execute an executable from Linux with javascript

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

Upvotes: 1

Views: 2882

Answers (1)

glenn jackman
glenn jackman

Reputation: 247142

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;

Upvotes: 1

Related Questions