Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I need help with a *.bat file. I want to make a .bat file that creates a new directory with system date as the folder name (YYMMDD). Does anyone have a code for that?

I never had a way to do this in a BAT.
What OS are you using? With Windows, a VBScript could handle this easily. Otherwise, a small EXE could handle this and maybe there are some utilities out there already.

Hey, there is a way of doing that by .bat file. But you'll need EDLIN.exe. You may get it here:
http://filebox.vt.edu/users/alrobin2/home/edlin/download.html
(don't be scared with the page)(put it in a directory path, such as c:\windows)
You'll also need a complementar file, also posted below:--------------------------------------------
filename: datedir.bat
--------------------------------------------
@echo off
echo. |DATE |FIND "Current" > out.bat
edlin out.bat [lessthan] current.rep > nul
echo SET MONTH=%%4> current.bat
echo SET DAY=%%5>> current.bat
echo SET YEAR=%%6>> current.bat
call out.bat
MD C:\%YEAR%%MONTH%%DAY%
del out.bat
del current.bat
del out.bak
--------------------------------------------
============================================
--------------------------------------------
filename: datedir.rep
--------------------------------------------
1,#r-^Z,
e
--------------------------------------------NOTE: ^Z means CTRL+Z character. You may get it on dos edit by CTRL+P+Z. CTRL+Z is different from a "^" with a "Z" !!!
NOTE2: You may have noticed the "[lessthan]" in line number3 at the first file. You should put in place of that, the lessthan sign (inverse of >) This forum has problems with posting that character...
NOTE3: This will only work on an english dos. If you're using any other language, letme know.That's it. Any further questions, post a followup or mailme
Please letme know of the results.-- SECRET_DOOM --
email: secret_doom@hotmail.com

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |