I use node.js v4.4.4 and I need to run a .bat
file from node.js.
From the location of the js file for my node app the .bat is runnable using command line with the following path (Window platform):
'../src/util/buildscripts/build.bat --profile ../profiles/app.profile.js'
But when using node I cannot run it, no specific error are thrown.
What am I doing wrong here?
var ls = spawn('cmd.exe', ['../src/util/buildscripts', 'build.bat', '--profile ../profiles/app.profile.js']);
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);
});