Solved

Shedule a windows task for last day of every month

Posted on 2010-08-29
7
2,013 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:Dan560
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 2

Expert Comment

by:hydrokid
ID: 33553522
Have you tried. windows scheduler
Start -> Run -> Accessories -> System Tools -> Scheduler
0
 
LVL 2

Author Comment

by:Dan560
ID: 33553524
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
 
LVL 2

Expert Comment

by:hydrokid
ID: 33553528
Create a batch job and uses the windows scheduler to launch this batch job every month. on the last day
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 2

Author Comment

by:Dan560
ID: 33553533
My question is asking how I set the job to run at the last day of every month.

I cannot see this option.
0
 
LVL 2

Expert Comment

by:hydrokid
ID: 33553534
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
 
LVL 12

Expert Comment

by:Rant32
ID: 33554012
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
 
LVL 2

Accepted Solution

by:
Dan560 earned 0 total points
ID: 33554110
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

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
Learn about cloud computing and its benefits for small business owners.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question