Post a reply

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

00O00O00

Rename file to date while uploading it

Hi. I would need a script to upload files to a FTP server with adding the date to the filename automatically. Now I' using this without WinSCP:

set year=%date:~-4%

set month=%date:~-7,2%
set day=%date:~-10,2%
set year=%date:~-4%
set month=%date:~-7,2%
set day=%date:~-10,2%

@echo off

echo open xyz.com> upload1.ftp
echo ...>> upload1.ftp
echo ...>> upload1.ftp

echo binary>> upload1.ftp
echo hash>> upload1.ftp
echo cd Backup>> upload1.ftp
echo cd Server>> upload1.ftp
echo put ..\backup.7z.001 backup%day%%month%%year%.7z.001>> upload1.ftp

echo quit>> upload1.ftp

ftp.exe -v -s:upload1.ftp


How can I realise a simular "rename to date" function with WinSCP?