CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2001
    Posts
    24

    How to start/stop NT services?

    I wants to start & stop service using my app.
    Expecting a detailed soln as i m a beginner

    :-)

  2. #2
    Join Date
    Jul 2000
    Posts
    124

    Re: How to start/stop NT services?

    I'm not sure that you can do this in your app. I think you might have to create a batch file that does this for you...

    Erica


  3. #3
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: How to start/stop NT services?

    This will involve a lot of importing Win32 APIs into your code. I've never done it b4 but here are some functions (WIN32 APIs) that you can look into:

    OpenSCManager() to get SCM handle
    OpenService() to get the service handle
    ControlService() to stop the service
    CloseServiceHandle() to clsoe the service handle

    Good Luck,
    -Cool Bizs

    Good Luck,
    -Cool Bizs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured