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. How to stop a windows service in Visual Studio 2003

How to stop a windows service in Visual Studio 2003

Scheduled Pinned Locked Moved C#
questioncsharpvisual-studiotutorial
2 Posts 2 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.
  • D Offline
    D Offline
    Diego F
    wrote on last edited by
    #1

    Hello. In Visual Studio 2005, there is a Stop method that you can call from any method to stop the service. That is useful in case something went wrong. I see that in Visual Studio 2003, that method doesn't exist. How can I then stop the service from code?

    Regards, Diego F.

    T 1 Reply Last reply
    0
    • D Diego F

      Hello. In Visual Studio 2005, there is a Stop method that you can call from any method to stop the service. That is useful in case something went wrong. I see that in Visual Studio 2003, that method doesn't exist. How can I then stop the service from code?

      Regards, Diego F.

      T Offline
      T Offline
      TimFoxell
      wrote on last edited by
      #2

      Hi Diego, Although I'm not 100% sure of how to do it, hopefully this puts you in the right direction. A service can only be started or stoped by the OS (for what I understand anyways...). So to stop it you either have to use the Services management snap-in in Win2k / XP etc or the NET command from the command prompt. Stopping it from your code is probably going to be easier from the latter... NET Stop Hope this helps! Having said all the above... have a look see here... http://support.microsoft.com/kb/245230[^]

      TimmyFox

      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