'Problems determining the 1st Sunday in a month
This following if segment is not working right. What I want to do is do something special if and only if it is the 1st Sunday of the month and something else every other day. It appears to work for everything except if it is Sunday and day is <= 7 (1st Sunday of the month). Any help is appreciated.
@echo on
rem use for testing only
set mydow="Sunday"
set myday=5
if not "%mydow%"=="Sunday" goto NotRightDay
if %myday%<=7 goto FirstSunRoutine
goto over
:FirstSunRoutine
echo This is the 1st Sunday routine
goto over
:NotRightDay
echo This is not the 1st Sunday of the month
goto over
:over
echo done
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|