How to rename a file name to a prefix + current date in DOS batch file
Posted on 2000-03-20
My machine is an NT. Everyday, there will be a file (i.e. abc.txt) output to my NT server & I need to write a program (in DOS batch file) to rename the file from abc.txt to abc210300.txt
The 210300 means 21st March 2000, if today is 21/3/2000. So, everyday the program will be scheduled to run and reanme the abc.txt to
"abc" + current date + ".txt"
This is the batch file commands I have now, but I don't know how to put in the date portion.
rename c:\temp\abc.txt abc123.txt