Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Appending a Date to filename
Name: Steel Date: April 3, 2003 at 09:28:32 Pacific OS: NT 4.0 CPU/Ram: Pentium/?
Comment:
Hi,
What I am doing is creating a batch file that will take a backup of a configuration file on my NT 4.0 Web server. What I would like to do is copy it from one subdirectory to another on the same server, which I have complete, but my problem is that I want to append the date to the end of the file name in the format of "filename.txt.yymmdd". Is there a way to do this? Any help would be greatly appreciated.
Name: Secret_Doom Date: April 3, 2003 at 09:52:14 Pacific
Reply:
You can make the process automatic with a batch script (.bat file). Use this code to get current system's date into the variable %DATE% with the format YYMMDD:
@echo off for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set DATE=%%C%%A%%B set DATE=%DATE:~2%
Then after that, just use the variable as you will.
Summary: I have a similar problem to others who have poster here. I want to rename a file to include a date. I have read Secret_Doom's faq and it was quite helpfull, but what I want to do is to access the "L...
Summary: I want to copy (append a file to another) without overwriting...to the end of the exisiting. If I have a file in a directory and I want to copy another file there with the same name, I'd like to add ...
Summary: I have long wondered if it is possible to append a numerical datestamp or timestamp to a filename. If other words if a processed a file called "export.dat" how could I rename it to include today's da...