Daily Cup of WinSCP file Download with todays date [closed]

耗尽温柔 提交于 2019-12-10 12:25:15

问题


I want to use .bat and .txt files to download a daily file I have off of a remote directory

The root of the file is always the same, but the date changes...daily

get filename_yyyymmdd.txt

How can I search and download the file with today's date?

Thanks


回答1:


If you can rely on file timestamp, use file mask with time-constaint.

See WinSCP time based file download.


If you have to rely on a file name, use the %TIMESTAMP% syntax:

get filename_%TIMESTAMP#yyyymmdd%.txt

Also consider using WinSCP .NET assembly, instead of scripting. Particularly, if you know, say, PowerShell.



来源:https://stackoverflow.com/questions/16421729/daily-cup-of-winscp-file-download-with-todays-date

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!