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.
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.