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
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.