Solved

Create directory with current date

Posted on 2004-08-24
6
2,325 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
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

679 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