Creating files with dates and times in batch jobs
The article at the link below describes how to use the for loop with the date command to create files / directories with a date and time.
An example script looks like this :-
rem create directory based on current month
for /f "tokens=1-4 delims=/ " %%d in ("%date%") do set DIRNAME=Archive%%e-%%f
echo %DIRNAME%
mkdir %DIRNAME%
You can find more information in this excellent article at Computer Hope http://www.computerhope.com/issues/ch000987.htm
An example script looks like this :-
rem create directory based on current month
for /f "tokens=1-4 delims=/ " %%d in ("%date%") do set DIRNAME=Archive%%e-%%f
echo %DIRNAME%
mkdir %DIRNAME%
You can find more information in this excellent article at Computer Hope http://www.computerhope.com/issues/ch000987.htm
| Next > |
|---|
