Start a process with elevated privilege

One of my process written in C# is forked by another process during application startup. This process needs administrator rights as it is accessing drivers, but the parent application (forking process) was launched in user mode.

There were two ways which I could think of: 1. Change the manifest, but the UAC dialog box would be irritating for the users. 2. Like Linux rpm installation, install the application with super user and give full control to the process

Is there any other better way of doing this? Please guide

Thanks

Answers


Please see Elevating process privilege programatically.

You either need to throw a UAC Elevation prompt (potentially annoying) or run your root forking process as administrator. By declaring it in the ClickOnce or program manifests, you can ensure that simple double-clicks on your executable will automatically prompt to elevate.

If the end user's machine has UAC enabled, at some point some kind of prompt will appear, as there is no legitimate way of elevating a child process from an unprivileged one.


Need Your Help

Simplemembership Provider ASP.NET MVC 4 Password Format

asp.net-mvc-4

I have moved along nicely migrating to simplemembership. The only thing that is hanging me up now is how do I configure password settings such as whether it's hashed, clear, or encrypted, etc. I do...

order of items returned by Dictonary<>.Keys

c# dictionary

if I do a foreach loop on Dictionary&lt;&gt;.Keys,

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.