hello i got a batch file, something like this:
if %day%==monday, tuesday, wednesday, thursday, friday (
goto yes
) else (
goto no
)
Now i know
From this answer, we have
wmic path win32_localtime get dayofweek
Expanding on this based on suggestions in this thread, we can set a dayofweek variable as follows:
@echo off
REM Unset dayofweek in case set in a previous execution of this batch file
set dayofweek=
REM Get dayofweek into a variable. Locale-specific: 0 is either Sunday or Monday.
for /F "skip=1 tokens=*" %%a in ('wmic path win32_localtime get dayofweek') do if not defined dayofweek set dayofweek=%%a
echo %dayofweek%
Note that 0 can be Sunday or Monday depending your locale.