I have used this many times to add a date in batch files. This example works for Windows batch files but can be adjusted for other uses.
You can set any variable, in my example below called “thedate” to a substring of the computers date to produce only the numbers without any “/” in case this needs to be used in creating folder or file names.
For my example I would like to use a script to create a photos folder with the date in the name:
then you can show your output
I then use
to create a folder called “photos_20150727”
The above was created using Window 7 but should work on Windows 10 as well..
Hope this helps. For some other tips using the command line see our list of other command line articles.