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

Reply to Message Icon

Name: charles_cp
Date: April 21, 2003 at 19:49:30 Pacific
OS: win 2000 pro
CPU/Ram: 700/256
Comment:

How do I rename a file with the current date?
eg test.txt to text20030422.txt
--------------
for /F %%A in ("%DATE%") do ren test.txt test%%C%%A%%B.txt

I used the command to renmae my text file, but the file will rename to "test%CTue%B"

Pls help




Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: April 21, 2003 at 20:45:08 Pacific
Reply:

That is covered on my FAQ:

FAQ #02 - Get system's current date into a variable without separators

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 2
Name: charles_cp
Date: April 21, 2003 at 22:53:38 Pacific
Reply:

thank you very much


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 with current date

create file with current datetime www.computing.net/answers/dos/create-file-with-current-datetime/13074.html

naming files with current date www.computing.net/answers/dos/naming-files-with-current-date/7725.html

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