I am copying and renaming files as below.
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
SET LOGFILE=file_transfer.log
call :Logit>>%LOGFILE% 2>&1
:Logit
echo Start time is: %date% %TIME%
set NEWFOLDER=new_folder
md "%NEWFOLDER%"
for /f "usebackq tokens=1,*" %%a in ("filelist.txt") do copy "%%a" ".\%NEWFOLDER%\%%b"
echo End time is: %date% %TIME%
:eof
When execute above script, I am getting log file as:
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
I need to get output in log file as:
1 file(s) copied - abc.jpg.
1 file(s) copied - xyz.jpg.
1 file(s) copied - 123.jpg.
How can I achieve this?