• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2350
  • Last Modified:

Create directory with current date

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
ChristopheLamarliere
Asked:
ChristopheLamarliere
  • 2
2 Solutions
 
For-SoftCommented:
What operating system are you using?
0
 
ChristopheLamarliereAuthor Commented:
XP Pro
0
 
For-SoftCommented:
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
 
shanekelly_7Commented:
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

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now