# Exec node exe has multiple msgs when there should be one (windows)

**URL:** <https://discourse.nodered.org/t/exec-node-exe-has-multiple-msgs-when-there-should-be-one-windows/82001>\
**Category:** General\
**Tags:** windows, exec\
**Created:** [13 October 2023 13:03 UTC](https://discourse.nodered.org/t/exec-node-exe-has-multiple-msgs-when-there-should-be-one-windows/82001 "2023-10-13T13:03:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mored](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mored](https://discourse.nodered.org/u/mored)\
**Post date:** [13 October 2023 13:03 UTC](https://discourse.nodered.org/t/exec-node-exe-has-multiple-msgs-when-there-should-be-one-windows/82001/1 "2023-10-13T13:03:22Z")

</div>

I have a C# console app that I've created that amongst other things runs a (sub?) process. When using the exec node to run the compiled binary the process that the exe creates seems to get picked up by node red. Can see the process id change and get two messages with the same msg id, one for when each process completes even though the node is set for only on completion. Does anyone had experience with this?  
This was the closest discussion I could find but was in regards to python and didn't seem to give me any ideas of things to try.  
[https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590)

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [13 October 2023 13:15 UTC](https://discourse.nodered.org/t/exec-node-exe-has-multiple-msgs-when-there-should-be-one-windows/82001/2 "2023-10-13T13:15:31Z")

</div>

Whilst I know .NET - I don't full understand, Node JS's process module, but 1 thing to maybe look at..

Is the `Process` object in .NET set to `RedirectStandardOutput = false`- that might explain why you are seeing the messages from the other process's? - as its bubbling up into Node, and not being handled by your parent process?

🤷‍♂️

---

<div class="post-metadata">

**Author:** ![mored](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mored](https://discourse.nodered.org/u/mored)\
**Post date:** [13 October 2023 13:18 UTC](https://discourse.nodered.org/t/exec-node-exe-has-multiple-msgs-when-there-should-be-one-windows/82001/3 "2023-10-13T13:18:45Z")

</div>

**RedirectStandardOutput = true;**  
**RedirectStandardError = true;**  
Yea I caught that when I was testing it without node-red as the sub process has a lot of useless output.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [13 October 2023 13:22 UTC](https://discourse.nodered.org/t/exec-node-exe-has-multiple-msgs-when-there-should-be-one-windows/82001/4 "2023-10-13T13:22:50Z")

</div>

On the premise you are handling the Process's output (`RedirectStandardOutput = true`), better wait for some other folk with more Node JS Process xp

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 December 2023 13:23 UTC](https://discourse.nodered.org/t/exec-node-exe-has-multiple-msgs-when-there-should-be-one-windows/82001/5 "2023-12-12T13:23:06Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
