I tried using this code:
SET Tmstp=%date:~7,2%%date:~4,2%%date:~10,4%%time:~0,2%%time:~3,2%%time:~6,2%
FOR %%V IN (%1) DO copy %%V %%V_%Tmstp%.bat && move %%V_%Tmstp% %Target%
echo %0
but it returns the filename in the format filename.bat_timestamp
, but I need it as filename_timestamp.bat
.
Any help will be great.