I have an application that I have to run as Administrator.
One small part of that application is to start other applications with Process.Start
The started applications will also be run as administrators, but I'd rather see them run as the 'normal' user.
How do I accomplish that?
/johan/
The WinSafer API's allow a process to be launched as a limited, normal, or elevated user.
Sample Usage:
Source code:
P/Invoke declarations:
I had the same requirement and I come to the solution to use the task scheduler service from Windows.
So, first add the
Task Scheduler Managed Wrapper
library to your project and use this code to create a task, configure it to run as limited user (td.Principal.RunLevel = TaskRunLevel.LUA;
), register the task, run the task and after finish, delete the task.From: http://go.microsoft.com/fwlink/?LinkId=81232
Here is an example of how to schedule the un-elevated process (again from the same link)