ServBit Experts Community
Need help with server administration?
-
How to rename a file name to a prefix + current date in DOS batch file
Posted on June 10th, 2009 3 commentsHi
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.
@echo off
echo.rename c:\temp\abc.txt abc123.txt
@echo off
Thank you.
n_chaithere is no way to write a batch file(*.BAT, with out using some sort of program.
I could wirte the program for you, use some programs i have at home.




JaneRadriges June 13th, 2009 at 21:29