Knowledge Base

How to automatically include the current date in a batch created file

Hint Ref: 020708170002
Hint Date: 17/08/2007

Hint Details:

To use the following DOS command line, you have to include the line into a batch file wherever it makes sense for you.
For example, to create a zip file with the year and month and day as part of the file name:
wzzip %date:~-4,4%%date:~-7,2%%date:~0,2%test.zip
In the above example, I am using Winzip Command Line Add-on.
The above serves as an example on how to make use of simple DOS commands to achieve a what is basically a simple task.
One look on the internet gives you dozens of ways to do that but they all lack one important characteristic; simplicity.