Create directory with current date

Posted on 2004-08-24
Last Modified: 2007-12-19

I'm trying to create a directory with the name as the current date in format yyyymmdd, can anybody tell me how to do this?

Question by:ChristopheLamarliere
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 10

Expert Comment

ID: 11879621
What operating system are you using?

Author Comment

ID: 11883983
XP Pro
LVL 10

Accepted Solution

For-Soft earned 25 total points
ID: 11884534
You can find solution here:

Or, you can use %DATE% variable with substring syntax:
To see details use SET /?

Assisted Solution

shanekelly_7 earned 25 total points
ID: 11923398
Here it is In Batch Script:-

::-------Start of Code--------::
@echo off
set y=%date:~-4%
set m=%date:~3,2%
set d=%date:~0,2%
set a=%y%%m%%d%
mkdir C:\<Path>\%a%
::----------End of Code-------::

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question