@echo off
:: ---------------------------------------------------------------
:: check to see if today is the last day of the month
:: ---------------------------------------------------------------
:: get today's month
Fdate /Ff /omm /vmmtoday
:: get tomorrow's month
Fdate /fadd /n1 /omm /vmmtomorrow
:: if tomorrow occurs in a different month,
:: then today is the last day of this month
if not (%mmtoday%)==(%mmtomorrow%) echo LAST DAY OF THE MONTH
if not (%mmtoday%)==(%mmtomorrow%) goto EndCheck
:: -------------------------------------------------------------
:: check to see if today is the last Friday of the month
:: -------------------------------------------------------------
:: get today's day of the week, to see if it is Friday
Fdate /Ff /odow3 /vdow3
if not (%dow3%)==(Fri) goto EndCheck
:: today is Friday. Get next Monday's month
Fdate /fadd /n3 /omm /vmmMonday
:: if next Monday occurs in a different month,
:: then today is the last Friday of this month
if not (%mmtoday%)==(%mmMonday%) echo LAST WORKING DAY OF THE MONTH
:EndCheck
:: cleanup
set dow3=
set mmtoday=
set mmtomorrow=
set mmMonday=