?
Solved

append current date to filename

Posted on 2003-03-28
3
Medium Priority
?
122 Views
Last Modified: 2011-08-18
Hi

I need help with renaming a text file with the current date in ms dos. This will be a part of a batch job.


Thanks
Ven
0
Comment
Question by:ven_13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
pbarrette earned 200 total points
ID: 8227168
Hi ven_13,

Windows 2000 has a built-in DATE variable. You can use it like this:
SET MYDATE=%DATE:~4,2%%DATE:~7,2%%DATE:~10,4%

This would create a variable called %MYDATE% which contains the current date in the format of MMDDYYYY

You can then rename your file like
REN MYFILE.EXT MYFILE-%MYDATE%.EXT

pb
0
 
LVL 5

Expert Comment

by:cempasha
ID: 8595578
This question is still open and getting old. If any of the comment(s) above helped you please accept it as an answer or split the points who ever helped you in this question. Your attention in finalising this question is very much appreciated. Thanks in advance,

****** PLEASE DO NOT ACCEPT THIS AS AN ANSWER ********

- If you would like to close this question and have your points refunded, please post a question in community support area on http://www.experts-exchange.com/Community_Support/ giving the address of this question. Thank you      

Pasha

Cleanup Volunteer


0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

770 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