I have an exec node which correctly connects to my PC via SSH, and I want to send a command when it does, but the exec returns code 0 (executed with no errors), but the command doesn’t run (it’s a command to adjust the brightness via controlmymonitor.exe, by Nirsoft).
The flow is like this: Inject → function → exec node with command ‘ssh USER@hostname’ and append msg.payload to exec, and spawn mode on.
the function is like this:
const value = 25; // Use msg.payload for a dynamic value
const command = `"C:\\_automationScripts\\controlmymonitor\\ControlMyMonitor.exe" /SetValue "\\\\.\\DISPLAY1\\Monitor0" 10 ${value}`;
msg.payload = command;
return msg;
now I’m not sure if I properly escaped the slashes (i’m sure I didn’t), but the return code shows as 0 on exec. Could someone please help me with fixing this function?
Once I have it corrected that value constant will be changed to a numeric value returned by a number slider.
On the controlmymonitor page the command line to change the brightness is like so: ControlMyMonitor.exe /SetValue "\\.\DISPLAY1\Monitor0" 10 100
local command line using that example works. Trying to do this via exec does not.
SSH is fine, I do get a proper return in debug with my local terminal responding.