I am trying to find out the day of the week using a batch file in the command prompt. the date /t command just displays the date 07/11/2005.
Does anyone know any way I can find out the day (whether its Mon-Sun)?
Thanks
Hi IVO,
You’re the man.
And you’re correct about the verbage.
Note that this bat sets the var DOW and depends only on skipping the correct number of chars, in this case 16.
:: setDOW.bat
@echo off
Echo.|Command /C Date>DOW
set /p today=<DOW
set DOW=%today:~16,3%
echo DOW=%DOW%
:: DONE
An inquiring mind might wonder why command.com transposes MM & DD.
But hey, IT’S WINDERS.
If at first you don’t succeed, you’re about average.
M2
The date /t, which is the same as:
echo %DATE%
output style depends on your settings.
Mine shows:
Mon 07-11-2005
Since your shows 07/11/2005, it will be a trick to get a batch to show DOW.
If at first you don’t succeed, you’re about average.
M2