Hi,
i need to run a script on the last day of a month. Is this possible?
Or do i have to run the script every day, check what day it is and if its not the last day of the month then quit and If its the last day process the whole script?
Or is there a better way?
Regards,
Matthias
How to schedule to run on last day of month?
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: How to schedule to run on last day of month?
I would use the following code and simply schedule it for every day:
Code: Select all
GetDate>today
DateAdd>today,d,1,tomorrow
DatePart>tomorrow,D,tomorrowDay
If>tomorrowDay=1
..
.. your code here
..
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: How to schedule to run on last day of month?
Marcus, thanks for sharing that code.
Regards,
Matthias
Regards,
Matthias
- CyberCitizen
- Automation Wizard
- Posts: 723
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Re: How to schedule to run on last day of month?
Such a simple solution, a fantastic program.
FIREFIGHTER
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: How to schedule to run on last day of month?
Wow, simple and effective. Love it!