Rename a file by its name and date using a batch file

I am trying to create a batch file that renames all the files in a folder named concatenate underscore and date. For example, if there is a file name> User1, then it will be> User1_25072012. I found code that changes the entire file name by date, but not by name and date, as in the above example.

Could you show me a way?

Thanks in advance.

0
source share
1 answer

It should do it

@echo off cd "C:\account folder" for /f "tokens=1-3 delims=/" %%a in ('echo %date%') do set today=%%a%%b%%c for %%f in (*.*) do ren "%%f" "%%~nf_%today%%%~xf" 
+1
source

Source: https://habr.com/ru/post/954172/


All Articles