Peter,
Intrigued by you request so did a spot of Googling. Should have been easy :sad: but the output format of the command line has changed from the old days. A simple "date" at the command line would have given the day of the week and date to operate on. Now it just gives the date. And so it is more complex.
Avoiding various small DOS addons to make life easier (some of which were shareware, some of which gave strange error messages), the answer is probably here (the final script).
http://www.windowsitpro.com/Article/Art ... .html?Ad=1
It doesn't return a number but the three letter day of the week, eg "Sat"
There is some clever coding there and modified to use the old DOS command.com which seems to be still in Windows XP!
So this in a batch file
=========================================
@ECHO OFF
rem Create the date and time elements.
For /f "tokens=1-7 delims=:/-, " %%i in ('echo exit^|command /k prompt $D $T') do (
For /f "tokens=2-4 delims=/-,() skip=1" %%a in ('echo.^|date') do (
set dow=%%i
set %%a=%%j
set %%b=%%k
set %%c=%%l
set hh=%%m
set min=%%n
set ss=%%o
)
)
rem Let's see the result.
For %%i in (dow dd mm yy hh min ss) do set %%i
==============================================
And %dow% contains the day of the week for futher batch code testing.
Someone else might come up with something more elegant but this looks like it should do the job with some testing of %dow% along the lines of:
IF "%dow%"=="Sat" .............etc
Hope this is of use.
Ian