Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. windows service scheduler

windows service scheduler

Scheduled Pinned Locked Moved C#
csharpquestioncareer
10 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arkiboys
    wrote on last edited by
    #1

    using .net 2.0, Is it possible to schedule the windows service manually (i.e. from services window under control panel) or do I have to implement a timer inside the service i.e. in the code? Currently I have scheduled the service to run on weekdays at 7:00 AM. This is done by having a timer in the code window. Is there a way to do the same thing manually? i.e. is there a scheduled job window to set the time, days, etc...? Thanks

    M J 2 Replies Last reply
    0
    • A arkiboys

      using .net 2.0, Is it possible to schedule the windows service manually (i.e. from services window under control panel) or do I have to implement a timer inside the service i.e. in the code? Currently I have scheduled the service to run on weekdays at 7:00 AM. This is done by having a timer in the code window. Is there a way to do the same thing manually? i.e. is there a scheduled job window to set the time, days, etc...? Thanks

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      arkiboys wrote:

      Is there a way to do the same thing manually? i.e. is there a scheduled job window to set the time, days, etc...?

      Go to Control Panel -> Scheduled Tasks -> Add Scheduled Task :rose:

      A 1 Reply Last reply
      0
      • M Manas Bhardwaj

        arkiboys wrote:

        Is there a way to do the same thing manually? i.e. is there a scheduled job window to set the time, days, etc...?

        Go to Control Panel -> Scheduled Tasks -> Add Scheduled Task :rose:

        A Offline
        A Offline
        arkiboys
        wrote on last edited by
        #3

        Hi, Not sure what which program to choose?

        M 1 Reply Last reply
        0
        • A arkiboys

          Hi, Not sure what which program to choose?

          M Offline
          M Offline
          Manas Bhardwaj
          wrote on last edited by
          #4

          Choose the service which you want to schedule. :confused:

          A 1 Reply Last reply
          0
          • M Manas Bhardwaj

            Choose the service which you want to schedule. :confused:

            A Offline
            A Offline
            arkiboys
            wrote on last edited by
            #5

            There is no windows service in the list

            M 1 Reply Last reply
            0
            • A arkiboys

              There is no windows service in the list

              M Offline
              M Offline
              Manas Bhardwaj
              wrote on last edited by
              #6

              Dude, Even Windows Service is an .exe file with no interface. Browse to the folder where you have installed or created that.

              A 2 Replies Last reply
              0
              • M Manas Bhardwaj

                Dude, Even Windows Service is an .exe file with no interface. Browse to the folder where you have installed or created that.

                A Offline
                A Offline
                arkiboys
                wrote on last edited by
                #7

                I see what you mean. Many thanks

                1 Reply Last reply
                0
                • M Manas Bhardwaj

                  Dude, Even Windows Service is an .exe file with no interface. Browse to the folder where you have installed or created that.

                  A Offline
                  A Offline
                  arkiboys
                  wrote on last edited by
                  #8

                  I have set the scheduler but it gives an error: can not start service from the command line or a debugger. A windows service must be installed (using installutil.exe)...) Please note that I have installed it correctly. If I start the service in the control panel/services, then the service runs but I do not want to start it manually. I now want the service to run based on the scheduled task. Thanks

                  S 1 Reply Last reply
                  0
                  • A arkiboys

                    I have set the scheduler but it gives an error: can not start service from the command line or a debugger. A windows service must be installed (using installutil.exe)...) Please note that I have installed it correctly. If I start the service in the control panel/services, then the service runs but I do not want to start it manually. I now want the service to run based on the scheduled task. Thanks

                    S Offline
                    S Offline
                    SimulationofSai
                    wrote on last edited by
                    #9

                    You cannot run the exe and expect the windows service to start. Please wipe that idea off. Create a batch file with the following line net start yourservice Again this assumes that the service is already installed and is in System32. If not you've to navigate to the path where your exe is and run the above command. cd your path net start yourservice You can then schedule this batch file to run at any desired time. The downside is that you need to stop the service manually too, so that it does not error out in the next scheduled start. So another batch file, another scheduled task which runs after your start task. net stop yourservice Above all, I thought the whole point in creating a windows service was to do something constantly in the background. I reccomend putting in that timer in your service.

                    SG

                    1 Reply Last reply
                    0
                    • A arkiboys

                      using .net 2.0, Is it possible to schedule the windows service manually (i.e. from services window under control panel) or do I have to implement a timer inside the service i.e. in the code? Currently I have scheduled the service to run on weekdays at 7:00 AM. This is done by having a timer in the code window. Is there a way to do the same thing manually? i.e. is there a scheduled job window to set the time, days, etc...? Thanks

                      J Offline
                      J Offline
                      Joseph Guadagno
                      wrote on last edited by
                      #10

                      You can create a batch file with the following line net start _serviceName_ and schedule it to run when you want. Replace the serviceName with the name of the service. If you are not sure what the name of the service is you can run net start from the command line to get a list of services. You can also schedule net stop _serviceName_ to stop the service. As an alternative, I wrote a replacement for the Windows Scheduler application, that allows you to write your own .NET assemblies to schedule.

                      Here are some of my articles. Hope this helps! Joseph Guadagno http://www.josephguadagno.net

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups