1.

Solve : Creating a Folder with the Date as a Name?

Answer»

I'm TRYING to WRITE a batch file once a week to do back ups and I want it to create a folder and name it the date.
So if the date is 1-20-06 then I want the folder to be named 1-20-06.

I've toyed with a few things to try and do this but nothing works so far.

Any help would be grateful!It would have been helpful had you mentioned your OS as not all methods run on all versions of DOS/Windows. This may run on your machine:

Code: [Select] for /f "tokens=6-8 delims=/: " %%a in ('echo. ^| date') do (
set mm=%%a
set dd=%%b
set yy=%%c
)

Use %mm%-%dd%-%yy% to develop your file name.

Hope this HELPS. 8-)I am running XP Pro SP1

I'll try that later and see if it works
Thanks!Hey thanks so much I GOT it to work

Do you know any sites with good tutorials on DOS scripting? This site has a good listing of the DOS commands but not really much past that.

Like what do the delims and tokens commands do?
I just haven't seen that used anywhere.



Discussion

No Comment Found