0
나는 스폰에서 cmd를 실행하고 싶지만 명령을 실행할 때 응답을받지 못합니다. 어떻게 해결할 수 있습니까?nodejs에서 스폰에서 cmd를 실행하는 방법
var terminal = require('child_process').spawn('cmd', ['/K'], { timeout : 1000*60*60*24 });
terminal.stdin.setEncoding = 'utf-8';
terminal.stdin.write(new Buffer('dir'));
terminal.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
terminal.on('exit', function (code) {
// console.log('child process exited with code ' + code);
});