Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 707733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:18:41+00:00 2026-05-14T04:18:41+00:00

I m able to build a windows service and install it. I m curious

  • 0

I m able to build a windows service and install it.

I m curious how can i run this service every hour ? I want it to run every hour periodically.

I also need to know the hour range that it s running so that I can store it somewhere.

How can i do that?

Edit : This service will be installed on many machines, therefore, I dont want to create a scheduled task say on 100 servers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:18:42+00:00Added an answer on May 14, 2026 at 4:18 am

    If you want a task to run on a regular interval as opposed to constantly, you should look into using the Task Scheduler.

    If you need your code to be a service, but to be “activated” every hour, the easiest approach would be to make your service a COM object and have a simple task scheduled every hour that invokes a jscript/vbscript that creates your COM object and calls simple method on it.

    The alternative is to use any of the wait APIs to “waste” an hour without consuming cycles.

    Note that you also have to consider some interesting design decisions that depend on what your scenario is:

    • how is your service going to be started if it crashes or is stopped by the user?
    • if you are started after more than an hour, should you run again or do you need to wait to get on the exact hourly schedule?
    • how do you keep track of the last “activation” time if the timezone or the day-light saving time has changed while you were not active?
    • does your service prevent the computer from going to sleep/hibernate on idling or when the laptop cover is closed? if not, do you need to awake the computer on the hour to get your service working on your schedule?

    Some of those are taken care of by the task scheduler, so I would strongly recommend going that route vs. waiting for an hour in your code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So far, I've been able to create a Windows Service, which I can then
I want to build a windows service that will use a remote encoding service
I need to be able to build all directories up to and including the
I want to be able to build our small codebase from TeamCity and we
This is a weird one. I created a new Windows Service in C#, and
We need to be able to deploy a couple of windows services to the
I'm attempting to build a Rails application that uses Amazons S3 service. I'm able
I'm a research student and I want to build a windows cluster at home
I'm trying to build a WCF self hosted service (eventually in a windows service)
Is the ZIP compression that is built into Windows XP/Vista/2003/2008 able to be scripted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.