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

Advertisement

foriamryan
Joined:
Posts:
1

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,670
Location:
Prague, Czechia

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.

Reply with quote

Advertisement

You can post new topics in this forum