C# – Running as admin sometimes

c++uacwindows-vista

I have a program that needs to run as a normal user most of the time, but once in a while I need to stop and start a service. How do I go about making a program that runs as a normal user most of the time but elevates into administrator mode for some function?

Best Solution

As far as I know, you need to start a seperate process that runs as the administrator. You can't elevate a process once it's already been started.

See this question.