e.g. cd c:\myfiles\%<month>%.
Now, I don't care if <month> is 11 for november or Nov or whatever,
but I am having difficulty just getting the two digits out of the date
environment variable.
I have found lots of stuff about creating filenames based on date and
time and replacing slashes with fantastic FOR loops and all others
things but I have not found anything yet that says "OK forget the rest
of date, I just want the month part..." (and again it can be 11 or Nov
- if its 11 I am sure I can do a 'case' to get to Nov!!)
If anyone has the solution, I would be v grateful.
Ta v m
The following is predicated upon the assumption that 'date /t' produces
output like 'Wed 11/07/2001' (American date setting of 'Day mm/dd/yyyy'):
01. @echo off
02. setlocal
03. for /f "tokens=2 delims=/ " %%a in (
04. 'date /t'
05. ) do set /a MM=1%%a - 100
06. for /f "tokens=%MM%" %%a in (
07. "January February March April May June July August
08. September October November December"
09. ) do set MONTH=%%a
10. set MONTH
If your date format is 'Day dd/mm/yyyy', then in line 3 you would have
to change 'tokens=2' to 'tokens=3'.
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