How to put the date usual format in Winscp script?
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?
Advertisement
Advertisement
What is your side? You can use any other scripting language anyway.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
Advertisement
Thanks for the hint. I have added it to example.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
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.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.
Advertisement
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\
Advertisement
You can post new topics in this forum