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

Advertisement

Lionfish
Guest

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

Reply with quote

Advertisement

Lionfish
Joined:
Posts:
1
Location:
Australia

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"

Reply with quote

Advertisement

You can post new topics in this forum