1.

Solve : Create file with current date?

Answer»

I have a batch file which creates a directory named, Backup. I would like INSTEAD to create a directory named the current days DATE so that each day it is RUN the data goes into a new directory. How can I do this?You never MENTIONED an OS but this work on most of them:

Code: [Select]
@echo off
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (
set mm=%%a
set dd=%%b
set yy=%%c
)


Once you have the variables, you can use them as you wish. Example md %mm%%dd%%yy% will make a directory with today's date. Use your imagination.

Hope this helps.



Discussion

No Comment Found