Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6558381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:11:32+00:00 2026-05-25T13:11:32+00:00

Note : question regarding Windows shell I want to write a simple batch script

  • 0

Note : question regarding Windows shell

I want to write a simple batch script to create a folder name is it does not exist with the system date as the name of the folder.

Current system date :

$ date /t
Sat 09/10/2011

I want the folder name to be created in the format dd-mm-yy and in the C:\ dir
10-09-11

First I tried according to this (Link to microsoft doc for date)

$ date dd-mm-yy /t

this was supposed to get me the date in the format I wanted but instead it just returned the same format as above.

To make the dir I tried

$ mkdir "%date dd-mm-yy /t%"

and many such variations with no success.

I just want to create a folder name with the system date in format dd-mm-yy, It would be good if I can have the folder name in a variable as I need to use it to copy files into this folder later in the batch script

Can anyone help me out?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:11:33+00:00Added an answer on May 25, 2026 at 1:11 pm

    I once had a same problem. Windows shell is so weak 🙁
    My solution was to use substring.

    set X=%DATE%
    mkdir %X:~3,2%-%X:~,2%-%X:~8,2%
    

    Note: DATE string is in language specific format that can only be changed in the regional setting of the control panel. So the substring parameter may have to be tweaked. For example I got 2011/09/10 for Japanese language.

    REM for Japanese language setting
    mkdir %X:~8,2%-%X:~5,2%-%X:~2,2%
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note my question is not regarding != but |= A usage example is here
(NOTE: This question is not about escaping queries, it's about escaping results) I'm using
Moderator note: This question is not a good fit for our question and answer
(note that this question is not about CAS, it's about the May fail spuriously
One question regarding whether the following code should yield a compiler warning or not
This is somewhat of a general question regarding Windows programming: Are Window messages "reliable"?
This is NOT a question on plain old boring customization; I actually want to
I had a question regarding this program I was trying to write. fin =
Reading this question I found this as (note the quotation marks) code to solve
Note The question below was asked in 2008 about some code from 2003. As

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.