For this you can use the standard module child_process.spawn () .
From the sample documentation:
var spawn = require('child_process').spawn, ls = spawn('ls', ['-lh', '/usr']); ls.stdout.on('data', function (data) { console.log('stdout: ' + data); }); ls.stderr.on('data', function (data) { console.log('stderr: ' + data); }); ls.on('exit', function (code) { console.log('child process exited with code ' + code); });
Replace 'ls' with 'c:/windows/system32/cmd.exe' and ['-lh', '/usr'] with ['/c', 'batfile.bat'] to run the batfile.bat batch file.
source share