A batch file that creates a new folder with the current date and time as the folder name

My colleague used something like “software that puts a new folder on the desktop with today’s date as folder name when executed”. Moreover, it is said that it is necessary to pay for proper use. I thought that it would not be worthwhile to take money by just creating a batch file of several lines of commands.

(↑ typo, can be attached → made)

So I made a batch file.

Batch file included zip download

Click on the link above to download and unzip the downloaded zip file, you can create mdc.bat and mdd.bat.


When you execute it, the command prompt screen will appear momentarily, create the new folder with the current date and time as the folder name in the directory containing the batch file. (Ex. The folder name is “20090209-193425” if it is 19:34:25 February 9, 2009)

Unlike mdc.bat, I create folders on my desktop no matter where I run it.

If you put it in the windows folder, just enter “mdd” with “execute with specified file name” (windows + R) and press Enter, make the current date and time as the folder name on the desktop and create a new folder It will be. (If you change the file name to whatever you like, you can run it with the file name without the extension (“d” for “d.bat”))

Please use it as you like. You can rewrite the code as you like.

If you want to change the naming convention from “20090209-193425” to “20090209193425”, open the batch file with a text editor and set “% nDate% -% nTime%” to “% nDate %% nTime%” Please rewrite. If you want to only date, please change “% nDate% -% nTime%” to “% nDate%”.

In addition, we can not take any responsibility for any damage suffered by using this file. … just in case w



Leave a Reply