Here's an often overlooked fact about VBScript: it handles Date calculations with wonderful simplicity. For instance, if you want to get yesterday's date, you just specify
Now() returns today's date and time.
Another function,
Day( Now() ) returns today's day in the current month. So if we subtract the latter from the former, we get the last day of the last month!
Watch.log "Last day of last month: " & (now-day(now)),4
Note that this works across all months and years without any extra code... and without having to bother with leap years!