Answer the question
In order to leave comments, you need to log in
How to use Child process to track a program that starts another program?
Hello. I have a console .exe that launches the main application, and closes after that.
let child = child_process.fork('run.exe', ['--username', this.userName])
child.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
child.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});
child.on('close', (code) => {
console.log(`child process exited with code ${code}`);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question