how do i rename the file using batch. How to rename a files with current date.for example my file name is hope.txt after i run batch it should be like hope.dd.mm.yyyy.txt
this might do it for one file (full-name supplied on commandline), depending, as always, on your date format. @echo off & setlocal
for /f "tokens=2-4 delims=-/ " do set dname=%%b.%%a.%%c
set base=%~n1%
set ext=%~x1%
ren %1 %1.%dname%%extif you want the file's date to be the name, that's another matter, but do-able.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |