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: winscp

ritika wrote:

I need to download file(filename with today's date in it) from Linux server using winscp.I am using WINSCP.COM /script and running it by batch script.how can I specify current date with its proper formatting(dd_mm_yyyy) in winscp.com so it downloads desired file.


get /path/prefix%TIMESTAMP#dd_mm_yyyy%suffix c:\path\

See https://winscp.net/eng/docs/scripting#timestamp
ritika

winscp

I need to download file(filename with today's date in it) from Linux server using winscp.I am using WINSCP.COM /script and running it by batch script.how can I specify current date with its proper formatting(dd_mm_yyyy) in winscp.com so it downloads desired file.
Guest

Re: dates in scripts

martin wrote:


First make sure that you have the latest version of WinSCP. Also you may need to enable windows shell extensions for the advanced usage of for command.


The error was that I had not the latest version of WinSCP.
Thanks!
martin

Re: dates in scripts

o5tech wrote:

Thanks for the example but I cannot use %DT% in my script.

...

And I have the following error:
File or folder 'C:\%DT%\*.*' does not exist.

First make sure that you have the latest version of WinSCP. Also you may need to enable windows shell extensions for the advanced usage of for command.
o5tech

Re: dates in scripts

Thanks for the example but I cannot use %DT% in my script.

My script is something like:
...
put C:\%DT%\*.* /tmp
...

And I have the following error:
File or folder 'C:\%DT%\*.*' does not exist.

What I have to do?
Thanks!!!
martin

Re: dates in scripts

steve wrote:

get realdate.com from www.huweb.hu/maques/realdate.htm
then call winscp from a batch file thus :-


for /f %%i in ('realdate.com /d') do (set DT=%%i)
"C:\Program Files\WinSCP\WinSCP.exe" /console /script=m:/app/cron/auto.ftp
exit

Then in your ftp script get a date in the form 20080724 using %DT% :D

Thanks for the hint. I have added it to example.
steve

dates in scripts

get realdate.com from www.huweb.hu/maques/realdate.htm
then call winscp from a batch file thus :-


for /f %%i in ('realdate.com /d') do (set DT=%%i)
"C:\Program Files\WinSCP\WinSCP.exe" /console /script=m:/app/cron/auto.ftp
exit

Then in your ftp script get a date in the form 20080724 using %DT% :D
martin

tom_shen wrote:

If i do not have PHP tool on my side, Any other method to download the file.
The file name format is YYYYMMDD_xxxxxxx.XLS

What is your side? You can use any other scripting language anyway.
tom_shen

If i do not have PHP tool on my side, Any other method to download the file.
The file name format is YYYYMMDD_xxxxxxx.XLS
martin

Re: How to put the date usual format in Winscp script?

See examples.
Tom_shen

How to put the date usual format in Winscp script?

I use winscp script to get file from server.
normal file is ok. but i met some file with the date in the file name. such as 20080708abcd.txt.
could i use any funcation to get this kind of file?
could winscp script sopport this?