Rename file with current datetime appended to filename

Solved/Closed
Betty - Sep 24, 2008 at 01:15 PM
 Sarath - Mar 26, 2013 at 03:28 AM
Hello,

I have the following bat file:
FOR %%V IN (%1) DO FOR /F "tokens=1-5 delims=/: " %%J IN ("%%~tV") DO ECHO Rename "%%V" %%L%%J%%K_%%M%%N%%~xV

This will rename the files to the datetime stamp. However I want to append the datetime to the filename.
Example:
filename: betty.rpt rename to betty0924081530.rpt

Can you help me with the correct syntax?

Thanks, Betty
Related:

9 responses

Set TDate=%date:~10,4%%date:~4,2%%date:~7,2%
FOR %%V IN (%1) DO Rename %%V %%V%TDate%
55