Solved

Create directory with current date

Posted on 2004-08-24
6
2,331 Views
Last Modified: 2007-12-19
Hi,

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?

Thanks
0
Comment
Question by:ChristopheLamarliere
[X]
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
6 Comments
 
LVL 10

Expert Comment

by:For-Soft
ID: 11879621
What operating system are you using?
0
 

Author Comment

by:ChristopheLamarliere
ID: 11883983
XP Pro
0
 
LVL 10

Accepted Solution

by:
For-Soft earned 25 total points
ID: 11884534
You can find solution here:
http://www.experts-exchange.com/Operating_Systems/MSDOS/Q_21081302.html

Or, you can use %DATE% variable with substring syntax:
%DATE:~0,2%
To see details use SET /?
0
 
LVL 1

Assisted Solution

by:shanekelly_7
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-------::
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

737 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