mkdir help (1 more ?)

  • Thread starter Thread starter ryan
  • Start date Start date
R

ryan

thanks for the reply thats what i was looking for, but i
have one more question. how can i make the sud directories
names (06-01-04, 06-02-04, 06-03-04, 06-04-04, 06-05-04.
-----Original Message-----


for /l %%a in (1,1,10) do md %%a

--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l
.
..
 
thanks for the reply thats what i was looking for, but i
have one more question. how can i make the sud directories
names (06-01-04, 06-02-04, 06-03-04, 06-04-04, 06-05-04.

.
Use UnivDate.bat from tip 4835 in the 'Tips & Tricks' at http://www.jsiinc.com
to create the %yy% %mm% and %dd% variables.

Then depending on your settings:

set /a yy=10000%yy%%%10000
if %yy% LSS 10 set yy=0%yy%&goto domm
if %yy% LSS 100 goto domm
set yy=%YY:~2,2%
:domm
set /a mm=100%mm%%%100
if %mm% LSS 10 set mm=0%mm%
set /a dd=100%dd%%%100
if %dd% LSS 10 set dd=0%dd%

Now that you have a 2 digit year (%yy%), month (%mm%), and day (%dd%)
variable for today, you can use them as you wish.






Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
ryan said:
thanks for the reply thats what i was looking for, but i
have one more question. how can i make the sud directories
names (06-01-04, 06-02-04, 06-03-04, 06-04-04, 06-05-04.

- - - - - - - - - - begin screen capture Win2000 - - - - - - - - - -
C:\cmd>demo\testmd
md 06-01-04
md 06-02-04
md 06-03-04
md 06-04-04
md 06-05-04
md 06-06-04
md 06-07-04
md 06-08-04
md 06-09-04
md 06-10-04

C:\cmd>rlist demo\testmd.cmd
=====begin C:\cmd\demo\testmd.cmd ====================
1. @echo off
2. setlocal enabledelayedexpansion
3. for /l %%a in (1,1,10) do (
4. set /a num = %%a + 100
5. echo md %date:~4,2%-!num:~1!-%date:~-2%
6. )
=====end C:\cmd\demo\testmd.cmd ====================
- - - - - - - - - - end screen capture Win2000 - - - - - - - - - -

If the preceding does what you intend, remove the word 'echo' from line 5
to actually create the subdirectories.
 
Back
Top