Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
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)

Options

Topic review

martin

Re: get file%TIMESTAMP-1D%#dd-mm-yyyy%.csv does not resolve in script

The -1D feature was added recently. So make sure you have the latest version of WinSCP.
foriamryan

get file%TIMESTAMP-1D%#dd-mm-yyyy%.csv does not resolve in script

I did search the forum before posting this.

I am trying to script a transfer but I can't seem to get the %TIMESTAMP% variable to resolve correctly when a relational modifier is applied to increase (tomorrow) or decrease (yesterday) it.


For instance, this script will download the file named with today's date.
[code]option batch continue
option confirm off
open server
cd /dir
lcd C:\temp%
get file%TIMESTAMP#dd-mm-yyyy% C:\temp\
exit[/code]

But this one will not.
[code]option batch continue
option confirm off
open server
cd /dir
lcd C:\temp%
get file%TIMESTAMP-1D#dd-mm-yyyy% C:\temp\
exit[/code]

All of the posts I found reference the modified %TIMESTAMP% as the second parameter. Is renaming the file using the increased or decreased stamp the only place it will work correctly or should it work as written above?

And I know I can wrap it in batch, or js, or powershell, and may have to, but I wanted to know if this was a natively supported use case.