var exec = require('child process').execFile;
exec('C:\something.exe', function (err, data) {
console.log(err)
console.log(data.toString());
});
Asked
Active
Viewed 631 times
1
-
Check out this stack overflow answer that will resolve your query. https://stackoverflow.com/a/19762411/12843137 – Krunal Rajkotiya Aug 19 '21 at 10:50
1 Answers
0
You can accomplish this by using the exec
function from the built-in child_process
module as shown in the NodeJS documentation.
const { exec } = require('child_process');
exec('start program.exe', (error, stdout, stderr) => {
if (error) {
throw error;
}
console.log(stdout);
});

nick-w-nick
- 147
- 1
- 12
-
'installer.exe' is not recognized as an internal or external command, operable program or batch file. i get an error when i execute with the above method – sheshe Aug 19 '21 at 09:06