I am using node.js v4.4.4 and I need to run the .bat file from node.js.
From the location of the js file for my application, node.bat is launched using the command line with the following path (Window platform):
'../src/util/buildscripts/build.bat --profile ../profiles/app.profile.js'
But when using node I can not start it, there will not be any special errors.
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); });
source share