Computing.Net > Forums > Disk Operating System > Rename file to include 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 to include date

Reply to Message Icon

Name: dion de beer
Date: August 20, 2003 at 23:08:44 Pacific
OS: Dos
CPU/Ram: Pent 4 800mhz 256Ram
Comment:

I need to copy a file from its original name to {test.txt} to {20030819.txt}
The copied file name must contain the current date, How do I do This?



Sponsored Link
Ads by Google

Response Number 1
Name: bitbyte
Date: August 21, 2003 at 03:02:35 Pacific
Reply:


you can do it with datetime.com from my page http://plop.at

example batch:

@echo off
datetime set DATE1=!Y!m!d > date1.bat
call date1.bat
rename test.txt %DATE1%.txt



0

Response Number 2
Name: dion de beer
Date: August 21, 2003 at 04:43:49 Pacific
Reply:

Hi,

I tried the above on w2k and the file that is created is done so without a filename.
??????????/


0

Response Number 3
Name: bitbyte
Date: August 21, 2003 at 06:04:20 Pacific
Reply:


try this

@echo off
datetime.com rename test.txt !Y!m!d.txt > renit.bat
call renit.bat
del renit.bat


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 to include date

Rename file to yesterdays date www.computing.net/answers/dos/rename-file-to-yesterdays-date/13933.html

Renaming file to current date. www.computing.net/answers/dos/renaming-file-to-current-date/10321.html

Rename file to date.time.txt www.computing.net/answers/dos/rename-file-to-datetimetxt/14166.html