每日一杯WinSCP文件下载今天的日期

问题描述:

我想使用.bat和.txt文件下载远程目录中的日常文件

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

获取filename_yyyymmdd.txt

get filename_yyyymmdd.txt

如何搜索和下载文件今天的日期?

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

谢谢

如果可以依靠文件时间戳,请使用具有时间限制的文件掩码

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

请参见基于WinSCP时间的文件下载

如果必须依赖文件名,请使用 %TIMESTAMP%语法

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

get filename_%TIMESTAMP#yyyymmdd%.txt






还可以考虑使用 WinSCP .NET程序集,而不是编写脚本。特别是,如果您知道,例如PowerShell。


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