martin wrote:
This is correct. But from the "WinSCP3" in the path, I assume you are using some really ancient version of WinSCP. The %TIMESTAMP%
syntax is supported in the latest WinSCP 5.6.x RC version only.
Mr. Prikryl,
You are correct. I was testing with an outdated version of WinSCP, but I've upgraded to the latest version: 5.5.6 (Build 4746), but it still doesn't seem to work for me. For now, I'm just using a wildcard, but would like to use the actual file name if possible.
Working:
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to FTP server
open ftp://user:pass@ftp.company.com/
# Upload file
put C:\pathtofile\1234*
# Disconnect
close
# Exit
exit
Is this exactly how the code should appear?:
put C:\pathtofile\1234_%TIMESTAMP#mmddyy%_01