Shedule a windows task for last day of every month

Hi,

Is it possible to a shedule a task so that it runs on the last day of every month?

I cannot figure out how to do it.

I am runing windows 2003 server.
LVL 2
Dan560Asked:
Who is Participating?
 
Dan560Connect With a Mentor Author Commented:
I actually figured out how to do it through Sheduled Tasks

Source: http://trac.vtiger.com/svn/vtiger/vtigercrm/branches/4.2/cron/examples.txt

Code: schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /mo lastday /m *


0
 
hydrokidCommented:
Have you tried. windows scheduler
Start -> Run -> Accessories -> System Tools -> Scheduler
0
 
Dan560Author Commented:
Yes sorry I am running windows scheduler, i just cannot find the option to run the task on the last day of every month.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
hydrokidCommented:
Create a batch job and uses the windows scheduler to launch this batch job every month. on the last day
0
 
Dan560Author Commented:
My question is asking how I set the job to run at the last day of every month.

I cannot see this option.
0
 
hydrokidCommented:
the monthly option..
create 3 schedule.
1) for every month that has 31st
2) for every month that has 30
3) for the month of feb
0
 
Rant32Commented:
Task scheduler doesn't have a real setting for 'last day of the month' as you may have gathered.

Hydrokid's solution will work, but February's a bastard, isn't it? You need to schedule ahead for a few years, unless "the day before the last day of the month" is good enough every 4 years.

Another option is to schedule a simple VB script to run daily. Have the script figure out if it's the last day of the month and if so, have it kick off the actual command.

Example script is attached. If you need help with the commandline, please provide the needed command.
Commandline = """C:\Program Files\My Scheduled\Program.exe"" -a 1"

If Month(Now()+1) > Month(Now()) Or Year(Now()+1) > Year(Now()) Then
 returncode = CreateObject("WScript.Shell").Run(Commandline)
End If
WScript.Quit returncode

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.