1
var exec = require('child process').execFile;
exec('C:\something.exe', function (err, data) {
     console.log(err)
     console.log(data.toString());
});
Jan Černý
  • 1,268
  • 2
  • 17
  • 31
sheshe
  • 11
  • 2

1 Answers1

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