get -delete command not working properly

Advertisement

winonahealth
Joined:
Posts:
2

get -delete command not working properly

While working from the command line, I run the below command and it works as expected. It opens the FTP, takes out all .pgp files and places them into my local 'test' directory.

D:\Program Files\WinSCP3>WinSCP.exe /command "open companyStaging" "get TestFolder/*.pgp D:\ftp_files\test\" "exit"

My issue comes in while trying to clean up the remote directory with the '-delete' command added.

D:\Program Files\WinSCP3>WinSCP.exe /command "open companyStaging" "get -delete TestFolder/*.pgp D:\ftp_files\test\" "exit"

For some reason, it is treating '-delete' as the file name and returning "Can't get attributes of file '-delete'. No such file or directory. Error code: 2"

I've searched the forums and found no other examples, I'm not sure what could be happening. Any suggestions?
I have also tried putting the commands into a script and calling it, but came up with the same results.

Reply with quote

Advertisement

winonahealth

Version out of date

It looks like it's time for an upgrade. I didn't realize the version we were running was so out of date :p

The -delete command was introduced to WINSCP in version 4.1

Reply with quote

Advertisement

You can post new topics in this forum