I have the following line in a batch file (that runs on an old Windows 2000 box):
7z a QuickBackup.zip *.backup
How do I append the date to the QuickBackup.zip
file. So if I ran the batch file today, ideally, the file would be QuickBackup20090514.zip
.
Is there a way to do this?
Best Solution
Bernhard's answer needed some tweaking work for me because the %DATE% environment variable is in a different format (as commented elsewhere). Also, there was a tilde (~) missing.
Instead of:
I had to use:
for the date format:
c:\Scripts>echo %DATE%
Thu 05/14/2009