Post a reply

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

Lionfish

RESOLVED

Resolved my own issue - I think it was slashing behavior of paths that caused it.

This worked:
"put .\releases\current\*.7z" `


This didn't:
"put releases/current/*.7z"
Lionfish

Put command says the file does not exist while reading the name of the file

I am executing WinSCP commands in batch:

$WinSCPPath = ".\deployment\tools\WinSCP";


& "$WinSCPPath\WinSCP" /ini="$WinSCPPath\config.ini" /command `
"open scp://USER@HOST:PORT -privatekey=""./deployment/keys/scp_id.ppk"" -passphrase=""PASS PHRASE""" `
"rm build_drop/*" `
"put releases/current/*.7z" `
"exit";


When this runs, everything appears to work down to the "put" line where I get the error:
File or folder 'pack_20190104085125.7z' does not exist.

System Error.  Code: 2.
The system cannot find the file specified
(A)bort, (R)etry, (S)kip, Ski(p) all:


The reason why I'm confused is, that 'pack_20190104085125.7z' DOES exist and I did not hardcode it anywhere in the script so it means that WinSCP was able to read the filename. Why does it declare that the file does not exist?

Thanks,
L