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

Author Message
foriamryan
[View user's profile]

Joined: 2016-11-30
Posts: 1
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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26138
Location: Prague, Czechia
The -1D feature was added recently. So make sure you have the latest version of WinSCP.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License