Hello,
I need to rename some files daily to be imported to our system. I need to append the file creation date just before the actual name in the format YYYY MM DD and a dash so the filename become YYYY MM DD - actualFileName.txt
Can anyone help me with this?
Thanks
Daniel
Put date in filename
Moderator: DosItHelp
hey,
Something like:
Would append the date to the start of all files in the dir it is executed in.
Something like:
Code: Select all
@echo off
for /f "tokens=1,2,3 delims=/" %%a in ('echo %date%') do set foo=%%c %%b %%a
for %%a in (*.*) do ren "%%a" "%foo% - %%a"
Would append the date to the start of all files in the dir it is executed in.