Describe the problem/error/question
I want to ssh from n8n into a Windows 11 Pro account. From Linux to Windows it works, but not from n8n to Windows. I can’t specify a correct working directory. I tried the following:
C:\Temp
c:\Temp
“C:\Temp”
/c/Temp
C/:Temp
What is the error message (if any)?
Please share your workflow
Share the output returned by the last node
“Syntax error” or “can’t find path”, depending on the path.
Information on your n8n setup
n8n version: latest
Database (default: SQLite): postgresql 17
n8n EXECUTIONS_PROCESS setting (default: own, main): default
Running n8n via (Docker, npm, n8n cloud, desktop app): docker, npm, n8n self-hosted
Operating system: Debian 12
barn4k
September 16, 2025, 8:31am
2
hello @Runningman-work
try without the working directory, as on Windows that may not work
barn4k
September 16, 2025, 11:15am
4
in that case try with null value
Already tried that, receiveing the error “cannot read properties of null (reading ‘startsWith’)
barn4k
September 16, 2025, 12:01pm
6
You can try this solution
I was having trouble on my windows device with the working directory and I believe the issue is the default terminal was cmd but n8n sends ssh that works better with powershell. so i ran the command to change my default terminal that n8n would use:
PS C:\WINDOWS\system32> Set-ItemProperty -Path HKLM:\SOFTWARE\OpenSSH -Name DefaultShell `
>> -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
>> Restart-Service sshd
then my n8n node looked like:
…
I set the shell for OpenSSH with the following command:
Set-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"; Restart-Service sshd
Now the node works, thanks a lot!