Utility ?

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
 
B

branigan

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
 
D

David Candy

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)
 
L

LWG

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top