Rename file to date while uploading it

Advertisement

00O00O00
Guest

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?

Reply with quote

Advertisement

You can post new topics in this forum