Create directory with current date

Posted on 2004-08-24
Medium Priority
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 100 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 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

771 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