I'm trying to create tasks with an indefinite duration. On Windows Server 2008, if I don't specify the duration, then the duration is assumed infinite. However, on Windows Server 2003 a duration must be specified (and be equal or greater than the interval). Currently, I am just setting the task to have a duration of a year if it is meant to repeat a long time.
Is there a way to specify an indefinite duration on Windows Server 2003?
if (m_TimeInterval.m_Expire.Year < 2099) //xp and win7 max year is 2099
tTrigger.Repetition.Duration = m_TimeInterval.getDuration();
else if (!newVer) tTrigger.Repetition.Duration = m_TimeInterval.getInterval().Add(TimeSpan.FromDays(365));
tTrigger.Repetition.Interval = m_TimeInterval.getInterval();
tTrigger.Repetition.StopAtDurationEnd = true;
Notes:
newVer
is false since I am working with Task Scheduler 1.1 and not 1.2 or highertTrigger
is of type TimeTriggerI ended up using 1-1-2099 as 'indefinite'