Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ServiceController in Windows 7

Options
  • 01-12-2010 5:24pm
    #1
    Registered Users Posts: 4,037 ✭✭✭


    Hi,
    I have a Windows Service that I need to be able to stop and start in C# code.
    I can under Windows XP but on a Windows 7 machine I cannot because of security,.
    I want to do the following in code:
    Open services.msc and right click on a service and stop and start it.
    I have read up on Impersonation of a user but it seems to be impossible without passing in the username and password, which is a non-runner.


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Moved from Design to Development.


  • Registered Users Posts: 2,781 ✭✭✭amen


    I had this problem about two years ago and there is a way around it by registering the service in a certain but I can't remember what I did.

    I will see if I still have my notes


  • Registered Users Posts: 4,037 ✭✭✭lukin


    amen wrote: »
    I had this problem about two years ago and there is a way around it by registering the service in a certain but I can't remember what I did.

    I will see if I still have my notes

    Thanks, although I have since tried something; I am creating an entirely new web service and put something in the code to get it to start automatically when the OS is detected as Windows 7.


  • Registered Users Posts: 4,037 ✭✭✭lukin


    I tried the above and it didn't work so I am completley stumped.


Advertisement