Renaming file with create date

Hewlett-packard / P5700
March 4, 2009 at 05:46:03
Specs: Windows XP, intel 2.4
I am trying to append the create date to a txt file as ddmmyyhhmmss. But instead I get mmddyyyyhhmm. Can someone please help me with the format. thanks

this is what I have so far:
Echo off
for %%I in (test.txt) do (
for /F "tokens=1-6 delims=/-: " %%A in ("%%~tI") do (
set CRDATE=%%A%%B%%C%%D%%E
ren test.txt test_%CRDATE%_%CRTIME%.txt

See More: Renaming file with create date

Report •

March 4, 2009 at 07:31:51
You're not going to get seconds; FOR just doesn't give you that information (nor does DIR). VBScript will, but you're not using VBScript.

If month and day are in the wrong order, just swap %%A and %%B.

Report •
Related Solutions

Ask Question