Utility ?

  • Thread starter Thread starter David Candy
  • Start date Start date
D

David Candy

@echo off
echo. |date>date.txt
FOR /F "eol=E tokens=4,5,6,7,8* delims=/, " %%i in (date.txt) do Set Z=%%k-%%l-%%m
move "%~1" "%~1%Z%"
del date.txt

Make a batch file with these lines in it, drop a folder on it, folder renamed.

New Folder becomes New Folder01-12-2003
 
nice dave, will this also work for a file?

L
@echo off
echo. |date>date.txt
FOR /F "eol=E tokens=4,5,6,7,8* delims=/, " %%i in (date.txt) do Set
Z=%%k-%%l-%%m
move "%~1" "%~1%Z%"
del date.txt

Make a batch file with these lines in it, drop a folder on it, folder
renamed.

New Folder becomes New Folder01-12-2003
 
It should but the person who asked for it here only asked for it to do folders (I cut and pasted from a previous answer I made)
 
I noticed a utility a while back in this group that when included in a
script could rename a file with a date. Does anyone have it or know of where
I can get it? I basically want to rename files with the current date...

thx, L
 
Back
Top