skip to our work or skip to our software

Create a date and time stamped folder from cmd prompt « Media Modus. A creative, ideas led, website production & consultancy company. - +44 (0) 845 535 1716

« We keep learning…
Top 20 - Cool movie Icons for Twitter »

Create a date and time stamped folder from cmd prompt

ok so you need to create a directory based on the current time and date, a timestamp if you will.

its easy, type this into your cmd window:

mkdir %date:~-4,4%%date:~-7,2%%date:~0,2%-%time:~0,2%%time:~3,2%%time:~6,2%

this will give you a directory named like YYYYMMDD-HHMMSS

Enjoy.

  • Share/Bookmark

Tags: , , ,

2 Responses to “Create a date and time stamped folder from cmd prompt”

  1. Hazard ABio

    Just so you know this also depends on your locale settings,
    I tried to run this without any changes and got this
    “200910We-151909″

    the actual date string is
    “Wed 06/10/2009″

    so I did a little re-configuring of the string modifications
    ECHO %date:~-4,4%%date:~7,2%%date:~4,2%-%time:~0,2%%time:~3,2%%time:~6,2%

  2. @Hazard ABio

    Thanks for the suggestion, great work!

Leave a Reply

Media Modus. A creative, ideas led, website production & consultancy company. - +44 (0) 845 535 1716 was built by mediamodus.com and powered by vonhost.co.uk
You can subscribe to either entries (RSS) and comments (RSS). xxii09243036 Advertise on this site

                   listenability, compliance, and navigatability logo