Post a reply

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)


Topic review


A script to download, rename, and move files

Up until now, I have been been using WS_FTP but would like to switch to WinSCP.
I'm trying to convert this WS_FTP script into WinSCP:
"C:\Program Files (x86)\Ipswitch\WS_FTP 12\wsftppro.exe"

-s "s*.sqb"
-d "local:C:\PccDataRelay\LogDownloads\"
-rename tx_[yyyy]-[mm]-[dd]_[hh]-[tt]-[ss]_[OnlyName].[OnlyExt]
-move "/USERNAME/logs/transferred/"

I've been able to convert it partially:
cd C:\PccDataRelay\TestDownloads

"C:\Program Files (x86)\WinSCP\" /ini=nul /log=C:\PccDataRelay\AuditLogs\incremental_download.log /command ^
    "open s -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" ^
    "get /USERNAME/logs/*.sqb" ^

But that only downloads the files. How can I get it to rename and move the original files while also leaving them in-place on the FTP site?

Please note, I posted this question subsequently to StackOverflow as the issue is timely.

Thank you!