I start the background process (on windows) from the main electron, something like this:
app_exe = require("child_process").spawn(
"app.exe" ,
[ "--params", ... ],
{ stdio: "ignore" }
);
this works fine, I can see it from Process Explorer:

but I canβt kill the process when the electron is closed ( .on("closed")or on("window-all-closed"))
I tried child.kill([signal]), but also destroying the trees or taskkill to no avail: only the first process (6036 from the example) was killed, the second (5760) remains obsolete.
also exec taskkill /F /T /PIDdoesn't kill him.
the only way to kill is exec taskkill /F /IM app.exe /T, but this way I cannot start two instances of the electronic application.
i'm missing something obvious in process management on windows