Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 127
  • Last Modified:

append current date to filename

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
ven_13
Asked:
ven_13
1 Solution
 
pbarretteCommented:
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
 
cempashaCommented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now