PC Review


Reply
Thread Tools Rate Thread

Determine the 3rd Tuesday of each month, then perform an action c#

 
 
Jason
Guest
Posts: n/a
 
      31st Aug 2006
I've created a service in c# that performs a certain action at a particular
day of the month

I want this service to kick off the action every third Tuesday of the month.
How would I set the service to run a desired action if the day is equal to
the third day of the month? Would that be done by programming it or using a
timer ? How would that be done.



 
Reply With Quote
 
 
 
 
Marina Levit [MVP]
Guest
Posts: n/a
 
      31st Aug 2006
Are you sure you don't want to use windows scheduler to do this? This way
your service isn't just running constantly checking if it's time to run yet.
The scheduler will just start your executable at the right time.

"Jason" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've created a service in c# that performs a certain action at a
> particular day of the month
>
> I want this service to kick off the action every third Tuesday of the
> month. How would I set the service to run a desired action if the day is
> equal to the third day of the month? Would that be done by programming it
> or using a timer ? How would that be done.
>
>
>



 
Reply With Quote
 
Ben Voigt
Guest
Posts: n/a
 
      31st Aug 2006

"Marina Levit [MVP]" <(E-Mail Removed)> wrote in message
news:%23iR$(E-Mail Removed)...
> Are you sure you don't want to use windows scheduler to do this? This way
> your service isn't just running constantly checking if it's time to run
> yet. The scheduler will just start your executable at the right time.


For a complex check like this, I think it would be best to use Task
Scheduler to start your program every day at a particular time, then let
your program check if it's the third Tuesday, or six days after a blue moon,
or during Lent, or whatever special check you need.

>
> "Jason" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I've created a service in c# that performs a certain action at a
>> particular day of the month
>>
>> I want this service to kick off the action every third Tuesday of the
>> month. How would I set the service to run a desired action if the day is
>> equal to the third day of the month? Would that be done by programming
>> it or using a timer ? How would that be done.
>>
>>
>>

>
>



 
Reply With Quote
 
Marina Levit [MVP]
Guest
Posts: n/a
 
      31st Aug 2006
I think Task Scheduler already supports the concept of third Tuesday of
every month. I'm not sure what the advantage if of reinventing the wheel.

Sure, if the check goes beyond something that is already supported. But if
it's already there, why bother?

"Ben Voigt" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Marina Levit [MVP]" <(E-Mail Removed)> wrote in message
> news:%23iR$(E-Mail Removed)...
>> Are you sure you don't want to use windows scheduler to do this? This way
>> your service isn't just running constantly checking if it's time to run
>> yet. The scheduler will just start your executable at the right time.

>
> For a complex check like this, I think it would be best to use Task
> Scheduler to start your program every day at a particular time, then let
> your program check if it's the third Tuesday, or six days after a blue
> moon, or during Lent, or whatever special check you need.
>
>>
>> "Jason" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> I've created a service in c# that performs a certain action at a
>>> particular day of the month
>>>
>>> I want this service to kick off the action every third Tuesday of the
>>> month. How would I set the service to run a desired action if the day is
>>> equal to the third day of the month? Would that be done by programming
>>> it or using a timer ? How would that be done.
>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Ben Voigt
Guest
Posts: n/a
 
      31st Aug 2006
"Marina Levit [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I think Task Scheduler already supports the concept of third Tuesday of
>every month. I'm not sure what the advantage if of reinventing the wheel.


Ok, seems that it does. I'm more familiar with the "at" command for
managing scheduled tasks, which seems to be less powerful schedule-wise (but
lets you run tasks under the SYSTEM account).

>
> Sure, if the check goes beyond something that is already supported. But if
> it's already there, why bother?
>
> "Ben Voigt" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>> "Marina Levit [MVP]" <(E-Mail Removed)> wrote in message
>> news:%23iR$(E-Mail Removed)...
>>> Are you sure you don't want to use windows scheduler to do this? This
>>> way your service isn't just running constantly checking if it's time to
>>> run yet. The scheduler will just start your executable at the right
>>> time.

>>
>> For a complex check like this, I think it would be best to use Task
>> Scheduler to start your program every day at a particular time, then let
>> your program check if it's the third Tuesday, or six days after a blue
>> moon, or during Lent, or whatever special check you need.
>>
>>>
>>> "Jason" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> I've created a service in c# that performs a certain action at a
>>>> particular day of the month
>>>>
>>>> I want this service to kick off the action every third Tuesday of the
>>>> month. How would I set the service to run a desired action if the day
>>>> is equal to the third day of the month? Would that be done by
>>>> programming it or using a timer ? How would that be done.
>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Jason
Guest
Posts: n/a
 
      31st Aug 2006
You're correct Task Schedular will let me do that, however on a domain
enviroment, don't I need a domain account for it to run under?


"Ben Voigt" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Marina Levit [MVP]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I think Task Scheduler already supports the concept of third Tuesday of
>>every month. I'm not sure what the advantage if of reinventing the wheel.

>
> Ok, seems that it does. I'm more familiar with the "at" command for
> managing scheduled tasks, which seems to be less powerful schedule-wise
> (but lets you run tasks under the SYSTEM account).
>
>>
>> Sure, if the check goes beyond something that is already supported. But
>> if it's already there, why bother?
>>
>> "Ben Voigt" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>
>>> "Marina Levit [MVP]" <(E-Mail Removed)> wrote in message
>>> news:%23iR$(E-Mail Removed)...
>>>> Are you sure you don't want to use windows scheduler to do this? This
>>>> way your service isn't just running constantly checking if it's time to
>>>> run yet. The scheduler will just start your executable at the right
>>>> time.
>>>
>>> For a complex check like this, I think it would be best to use Task
>>> Scheduler to start your program every day at a particular time, then let
>>> your program check if it's the third Tuesday, or six days after a blue
>>> moon, or during Lent, or whatever special check you need.
>>>
>>>>
>>>> "Jason" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> I've created a service in c# that performs a certain action at a
>>>>> particular day of the month
>>>>>
>>>>> I want this service to kick off the action every third Tuesday of the
>>>>> month. How would I set the service to run a desired action if the day
>>>>> is equal to the third day of the month? Would that be done by
>>>>> programming it or using a timer ? How would that be done.
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Marina Levit [MVP]
Guest
Posts: n/a
 
      31st Aug 2006
You can specify in the scheduler what account the executable should be run
under. You provide the credentials, and the scheduler runs that task as if
it were started by the user.

"Jason" <(E-Mail Removed)> wrote in message
news:OB2$(E-Mail Removed)...
> You're correct Task Schedular will let me do that, however on a domain
> enviroment, don't I need a domain account for it to run under?
>
>
> "Ben Voigt" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> "Marina Levit [MVP]" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>I think Task Scheduler already supports the concept of third Tuesday of
>>>every month. I'm not sure what the advantage if of reinventing the wheel.

>>
>> Ok, seems that it does. I'm more familiar with the "at" command for
>> managing scheduled tasks, which seems to be less powerful schedule-wise
>> (but lets you run tasks under the SYSTEM account).
>>
>>>
>>> Sure, if the check goes beyond something that is already supported. But
>>> if it's already there, why bother?
>>>
>>> "Ben Voigt" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>>
>>>> "Marina Levit [MVP]" <(E-Mail Removed)> wrote in message
>>>> news:%23iR$(E-Mail Removed)...
>>>>> Are you sure you don't want to use windows scheduler to do this? This
>>>>> way your service isn't just running constantly checking if it's time
>>>>> to run yet. The scheduler will just start your executable at the right
>>>>> time.
>>>>
>>>> For a complex check like this, I think it would be best to use Task
>>>> Scheduler to start your program every day at a particular time, then
>>>> let your program check if it's the third Tuesday, or six days after a
>>>> blue moon, or during Lent, or whatever special check you need.
>>>>
>>>>>
>>>>> "Jason" <(E-Mail Removed)> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>>> I've created a service in c# that performs a certain action at a
>>>>>> particular day of the month
>>>>>>
>>>>>> I want this service to kick off the action every third Tuesday of the
>>>>>> month. How would I set the service to run a desired action if the day
>>>>>> is equal to the third day of the month? Would that be done by
>>>>>> programming it or using a timer ? How would that be done.
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Otis Mukinfus
Guest
Posts: n/a
 
      1st Sep 2006
On Thu, 31 Aug 2006 15:20:06 -0400, "Marina Levit [MVP]" <(E-Mail Removed)>
wrote:

>You can specify in the scheduler what account the executable should be run
>under. You provide the credentials, and the scheduler runs that task as if
>it were started by the user.
>

[snip]

Be careful (if you can) that the user you choose or create has a password that
does not expire. If you don't you'll have to go and change it at the end of
every expiration period. And that is a real pain ;o)
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dates and 1st Tuesday of month =?Utf-8?B?SmVzc2ljYQ==?= Microsoft Excel Worksheet Functions 11 17th Jul 2007 11:13 PM
Determine date based on day of month (i.e. 2nd Tuesday of the month) csb Microsoft Excel Discussion 4 9th Aug 2006 02:51 PM
Every 2nd Tuesday of the Month KC Microsoft Excel Misc 8 25th Nov 2004 03:31 AM
Format for 1st and 3rd Tuesday of each month? Roger Fuherdenhaden Microsoft Excel Discussion 1 26th Feb 2004 01:07 AM
first Tuesday in the month DL Microsoft Excel Programming 4 30th Nov 2003 10:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:43 PM.