dahall / TaskScheduler

Provides a .NET wrapper for the Windows Task Scheduler. It aggregates the multiple versions, provides an editor and allows for localization.
MIT License
1.21k stars 191 forks source link

Task Scheduler allows creation with out of bounds date #845

Closed xantari closed 4 years ago

xantari commented 4 years ago

If you create a task with an end boundary as follows:

trigger.EndBoundary = New DateTime(9999, 12, 31)

It will work, but when you try to open the created task within Task Scheduler and click on Triggers tab. Then clicked on Edit.

You get this:

image

Then this:

image

dahall commented 4 years ago

I'm afraid this is a bug with the Task Scheduler MMC app and not this library.

xantari commented 4 years ago

Should the library allow creation of those dates when the Task Scheduler UI only allows it to go to 12/31/9998 ?

image

When expiration is not defined it seems then 12/31/9999 11:59:59 PM is then allowed, but not 12/31/9999 12:00:00AM for some reason.

dahall commented 4 years ago

Given that there is no documentation that even limits the dates supported by the native COM interfaces around which this wrapper library is based, my inclination is not change the functioning of the library in case MS fixes their UI bugs at some point. I'd rather document the condition that you've found in the property documentation. Does that sound reasonable?

xantari commented 4 years ago

Sounds good!