I found a solution for him .. and his work is great for me. This opens a new command window and launches my main JS node in the child process. You do not need to specify the full path of cmd.exe. I made this mistake.
var spawn = require('child_process').spawn, ls = spawn('cmd.exe', ['/c', 'startemspbackend.bat']); 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); });
source share