Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

OokInTheComputer

And it is working as it should be.
Thank you for pointing out my mistake, I was using /incoming instead of /home/user/incoming.
Now forwards and upwards for world domination!
OokInTheComputer

Thank you for the replies.

I will check out your suggestions, and let you know what happened.
martin

Re: Error code 2 on SCP file from local to remote computer

Is your account really chrooted? Shouldn't the path rather be like /home/user/incoming?
Can you upload the file using WinSCP GUI? If you can, have it generate a code template for you:
https://winscp.net/eng/docs/ui_generateurl#code
If this does not help, post logs both from the GUI and the PowerShell.
OokInTheComputer

Error code 2 on SCP file from local to remote computer

Good afternoon all
I have an issue with PowerShell and WinSCP.
Basically I have code which checks for replication on HyperV, then SCP the result to an SCP server.
So far the script works well, except when SCPing the file.

My code:
$transferResult =
$session.PutFiles("C:\Reports\*.htm", "/incoming/", $False, $transferOptions)

When the code is run, I get the following message :
Error: Exception calling "Check" with "0" argument(s): "Cannot create remote file '/incoming/FileName2022-01-12.htm'.
No such file or directory.
Error code: 2
Error message from server: No such file"

I have checked and verified that the SSH account do have write access to the specified account, and I have SCP'd successfully from another computer using Posh-SSH with the same account.

Thanking you for your assistance in this regard.