Computing.Net > Forums > Disk Operating System > Rename file using date

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.

Rename file using date

Reply to Message Icon

Name: selector007
Date: February 11, 2004 at 05:33:23 Pacific
OS: 2000
CPU/Ram: penitum
Comment:

I would like to rename the below using the date format:

test.txt test11/02/2004

Is this possible?




Sponsored Link
Ads by Google

Response Number 1
Name: chadbh74
Date: February 11, 2004 at 09:07:43 Pacific
Reply:

Hi there...

While it is possible to rename a file to a file that has the date in it, the specific format you use is invalid as a filename. there can be no slashes "/" in a filename, DOS uses these to seperate directories when specifying pathnames. Also, in TRUE DOS (such as 6.22) you are limited to what is known as the "8.3" format. That being 8 letters then the "dot" then 3 letters for extension. When doing a "DOS Shell" under Windows '95 and above, this limitation is removed, but you still cannot use the slashes. Perhaps try "-" instead (11-02-2004)


0

Response Number 2
Name: FishMonger
Date: February 15, 2004 at 20:47:33 Pacific
Reply:

Here's how you'd rename the file using the current system date.

ren test.txt test%date:~4,2%-%date:~7,2%-%date:~10%.txt



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 Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Rename file using date

batch file to rename files by date. www.computing.net/answers/dos/batch-file-to-rename-files-by-date/5517.html

how to copy files using date www.computing.net/answers/dos/how-to-copy-files-using-date/12582.html

Rename file with date www.computing.net/answers/dos/rename-file-with-date/14091.html