Computing.Net > Forums > Disk Operating System > System date as folder name

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

System date as folder name

Reply to Message Icon

Name: Meelis Tints
Date: May 31, 2001 at 04:47:57 Pacific
Comment:

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?



Sponsored Link
Ads by Google

Response Number 1
Name: Logan
Date: May 31, 2001 at 11:08:27 Pacific
Reply:

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.


0

Response Number 2
Name: Secret_Doom
Date: June 2, 2001 at 12:49:13 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: System date as folder name

Want to use $DATE as logfile name.txt www.computing.net/answers/dos/want-to-use-date-as-logfile-nametxt/9373.html

current date as a file or directory name www.computing.net/answers/dos/current-date-as-a-file-or-directory-name/1664.html

PC-Date as Log-file name www.computing.net/answers/dos/pcdate-as-logfile-name/1953.html