If you run a console application from a console, it’s still going to run in the same console. The Windows console is just a convenience that opens automatically when you’re running a console application through Explorer.
You can try it yourself: open cmd.exe
first, then run ConsoleApplication.exe
. It won’t open a new window; the output will appear beneath your prompt. And then you’ll get another one.
If you want a window to show up, you can run cmd
manually:
exec("cmd /c ConsoleApplication.exe", function callback(error, stdout, stderr) {
appOut = stdOut;
console.log("started console app");
});