Sure, we can set a trigger on the last day of the month.
You'll need the latest version (4.0) of WinCron to run this script.
As you've found, CRON syntax doesn't support a notion of the "last day of the month". But, if we're clever, we can simply look ahead to see if we are about to fall over into the next month!
## Last Day of the Month script
# This script checks each night at 11:59 to see if the next minute
# will usher in a new month. If so, (put your code in here)
{
# At 11:59 PM each night...
-start -cron 59 23 * * *
# Every night at 11:59, check to see of this is the "Last Day Of the Month"
If LastDayOfMonth() = False Then WCCtrl.Return("break")
# Okay, it's the last day of the month; do stuff...
Print("It's the last day of the month!")
}
Function LastDayOfMonth()
LastDayOfMonth = False
' get the current date/time
initial_date = now
' this_month contains the number corresponding to the current month.
this_month = Month(initial_date)
' check_month contains the number corresponding to the current month + 1 minute.
check_month = Month(DateAdd("n", 1, initial_date))
' are we about to change months?
If this_month <> check_month Then LastDayOfMonth = True
End Function