# How do I launch an exe via exec (ssh'd into my windows pc) with parameters?

**URL:** <https://discourse.nodered.org/t/how-do-i-launch-an-exe-via-exec-sshd-into-my-windows-pc-with-parameters/96366>\
**Category:** General\
**Tags:** function-node, exec\
**Created:** [1 April 2025 10:38 UTC](https://discourse.nodered.org/t/how-do-i-launch-an-exe-via-exec-sshd-into-my-windows-pc-with-parameters/96366 "2025-04-01T10:38:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mxp83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mxp83/32/99892_2.png) [@mxp83](https://discourse.nodered.org/u/mxp83)\
**Post date:** [1 April 2025 10:38 UTC](https://discourse.nodered.org/t/how-do-i-launch-an-exe-via-exec-sshd-into-my-windows-pc-with-parameters/96366/1 "2025-04-01T10:38:52Z")

</div>

I can successfully ssh into my pc via node-red and now I want to launch a program with parameters, but it always returns on error and the program doesn't launch. the payload that is sent to the exec contains the program info with the params and the exec node is set to the command ssh [user@192.168.1.xx](mailto:user@192.168.1.xx)

I'm not entirely sure I used the proper escape strings. pwsh.exe is in my system and user paths, but i believe it breaks on the --slot part. If I manually ssh into my pc from the node red VM (proxmox) and run:  
`& "C:\PROGRA~1\reWASD\REWASD~1.EXE" select_slot "--id" "314856674055983265;4459543588222" "--slot" "slot3"`

it works, however via the exec it does not.

the function node prior to it is like so:

`msg.payload = '"C:\\Program Files\\PowerShell\\7\\pwsh.exe" -Command "& \\"C:\\PROGRA~1\\reWASD\\REWASD~1.EXE\\" select_slot --id \\"314856674055983265;4459543588222\\" --slot \\"slot3\\""'; return msg;`

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 April 2025 11:01 UTC](https://discourse.nodered.org/t/how-do-i-launch-an-exe-via-exec-sshd-into-my-windows-pc-with-parameters/96366/2 "2025-04-01T11:01:24Z")

</div>

Welcome to the forum @mxp83

Get it working first using a command window on the PC running node red. Then replicate the command you run in the exec node. If it won't work then show us the command you are entering in the command window that does work.

---

<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:** [30 June 2025 11:02 UTC](https://discourse.nodered.org/t/how-do-i-launch-an-exe-via-exec-sshd-into-my-windows-pc-with-parameters/96366/3 "2025-06-30T11:02:10Z")

</div>

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