Computing.Net > Forums > Windows XP > How to rename a file with date/time

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to rename a file with date/time

Reply to Message Icon

Name: AlvaChris
Date: May 21, 2004 at 20:13:26 Pacific
OS: Windows XP
CPU/Ram: Intel 2GB
Comment:

Hi,
I don't have much experience with DOS, and I need some help on how to rename a file indicating the system's date and time as the file's name. i.e.:

TextFile.dat would need to be rename to 05/21/04_20:07.dat

Thanks,

Chris



Sponsored Link
Ads by Google

Response Number 1
Name: XpUser
Date: May 21, 2004 at 21:11:08 Pacific
Reply:

Hi AlvaChris,

I believe you will need to write a batch file in order to achieve this. I'm not certain if a batch file such as this one(http://www.winnetmag.com/Articles/Print.cfm?ArticleID=13575) would work under XP. (It was created to work under the OS preceding XP.)


0

Response Number 2
Name: AlvaChris
Date: May 22, 2004 at 00:35:27 Pacific
Reply:

I'm almost there but not quite.

When using DOS on WindowsXP the date is represented as follows: i.e.
Sat 05222004

My batch program is suposed to rename a file with the current date. However I get a syntax error on the command line because of the space between "Sat" and "05". I have tried different ways to omit the day of the week but it seems that the system treats Sat 05 as one string element.
Any ideas?

Thanks,

Chris


0

Response Number 3
Name: Nigel Spike
Date: May 22, 2004 at 15:02:00 Pacific
Reply:

Does it have to be via "DOS" (I guess you mean Command Prompt). Otherwise D/L Total Commander. It lets you change all attributes of a file, including date and time.

Nigel


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: How to rename a file with date/time

Renaming a file with a datestamp www.computing.net/answers/windows-xp/renaming-a-file-with-a-datestamp/127258.html

How to open a port with Win XP www.computing.net/answers/windows-xp/how-to-open-a-port-with-win-xp/45389.html

Rename log file with date appended www.computing.net/answers/windows-xp/rename-log-file-with-date-appended/141143.html