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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

ServiceController in Windows 7

  • 01-12-2010 4:24pm
    #1
    Registered Users, Registered Users 2 Posts: 4,114 ✭✭✭


    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, Registered Users 2 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, Registered Users 2 Posts: 4,114 ✭✭✭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, Registered Users 2 Posts: 4,114 ✭✭✭lukin


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


Advertisement