This project has moved and is read-only. For the latest updates, please go here.

Application error if two values for x day of week in month chosen in Vista/Win7

Jun 25, 2012 at 8:55 PM

On Windows Vista and Windows 7, the Trigger dialog allows the Monthly->On setting to have more than one checked value for the x day of week in a month. If more than one value for the x day  (like Monday) of week (first, second, third, fourth, or last ) is checked, an application error is returned reporting "Only a single week can be set with Task Scheduler 1.0.".

On Windows XP (32 bit SP3 and 64-bit SP2) only one checkbox can be selected for the x day of the week for the month and does not expose the application error.

Jun 26, 2012 at 3:49 PM
Edited Jun 29, 2012 at 11:56 PM

This bug was already reported and is fixed in release 1.8.3 due shortly. I am close to posting the source code that has the fix.

Jun 26, 2012 at 4:41 PM

Thanks David!

Jun 27, 2012 at 6:22 PM

Hi David,

Looks like this is a regression. I've updated my source with the latest download, and the exception "Only a single week can be set with Task Scheduler 1.0." is still thrown eventhough I'm on a Windows 7 machine. I tried using the file Trigger.cs in commit 74464 and the exception is gone.

Thanks, Audi


Jun 27, 2012 at 7:18 PM
Edited Jun 27, 2012 at 7:22 PM

Putting the  following line code in the WeeksOfMonth property outside of the IF statement seems to be causing the issue:

v1TriggerData.Data.monthlyDOW.V2WhichWeek = value;

If I use the code in 74464 for the WeeksOfMonth property, the exception goes away.


Jun 29, 2012 at 6:26 PM


If I use the code in 74464 for the WeeksOfMonth property, the exception goes away (on Windows 7), but gets the following exception on Win XP:

Value does not fall within the expected range.

-------------------------- Technical Information Follows -------------------------- 

Exception Details:


Exception type: System.ArgumentException

Message:         Value does not fall within the expected range.

Source:         Microsoft.Win32.TaskScheduler

Target Site:     SetTrigger


Stack Trace:

   at Microsoft.Win32.TaskScheduler.V1Interop.ITaskTrigger.SetTrigger(TaskTrigger& Trigger)

   at Microsoft.Win32.TaskScheduler.Trigger.SetV1TriggerData()

   at Microsoft.Win32.TaskScheduler.Trigger.Bind(ITask iTask)

   at Microsoft.Win32.TaskScheduler.TriggerCollection.Add(Trigger unboundTrigger)

   at Microsoft.Win32.TaskScheduler.TaskPropertiesControl.triggerNewButton_Click(Object sender, EventArgs e)

   at System.Windows.Forms.Control.OnClick(EventArgs e)

   at System.Windows.Forms.Button.OnClick(EventArgs e)

   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

   at System.Windows.Forms.Control.WndProc(Message& m)

   at System.Windows.Forms.ButtonBase.WndProc(Message& m)

   at System.Windows.Forms.Button.WndProc(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Jul 2, 2012 at 6:14 PM

Try source code version 78863.

Jul 2, 2012 at 8:29 PM

Thanks David! Problems fixed, both in Win 7 and Win XP. Really appreciate it.