Unable to run command on remote machine via SSH

Describe the problem/error/question

Hello,

I have been working with n8n for a week now and mostly got it where needed. I have one last task to configure - run batch file ‘restart.bat’ on W2022 Server via SSH. The connection apears to work and it opens and closes it according to W2022 event viewer but it doesn’t execute. The file is located on the remote machine under c:\Tools\restart.bat. I am able to upload and download files, but not fond any gudance on how to run batch or powershell scripts via SSH.

What is the error message (if any)?

{
  "code": 1,
  "signal": null,
  "stdout": "",
  "stderr": "The filename, directory name, or volume label syntax is incorrect."
}

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.94.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Synology DSM 7.2.2 DMS OS (Debian based)

hello @kl4wisz

Try one of the below syntaxes for the working directory:

c:\\Tools\\

c:/Tools/

None of the syntaxes work. I have installed OpenSSL on Windows 2022 and can execute the script fine via Putty.

If anyone is interested how this was resolved:

  • change path from fixed to expression and leave it blank
  • put the command with desired path and this will execute the command as expected

2 Likes

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