Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Adding todays date to file names

Posted on 2008-10-07
1
Medium Priority
?
490 Views
Last Modified: 2012-05-05
Is there an easy way to add todays date to file names using .CMD

I want to copy all the files in a folder and create copies with today's date added to the file name

The folder would contain
test.txt
test2.txt
and after running the .cmd file the folder would contain
test.txt
test2.txt
test10072008.txt
test10072008.txt

thanks for the help
 
Pointer to duplicate (http:Q_23795717.html)

Reduced points to 20.
~sirbounty 
ee zape

Open in new window

0
Comment
Question by:derekstattin
1 Comment
 
LVL 3

Accepted Solution

by:
gcauthon earned 80 total points
ID: 22669406
for %i in (*.txt) do ren "%i" "%~ni%date:~10,4%%date:~4,2%%date:~7,2%.txt"
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
Integration Management Part 2
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question