Hi, I would like to execute an application from C# windows service to the logged in user's desktop. The service already runs using admin privileges. Is it possible to run the application on the users desktop using the service's admin privileges? How do I hook to the logged in user's desktop and execute the application? The logged in user is a normal user and the application requires administrator previleges to execute.
Currently I get the "explorer.exe" process, get the handle from the process, duplicate the logged in user's token and use the "CreateProcessAsUser" method to run the application on the user's desktop. But, since the logged in user is not a administrator, the executed application fails with the insufficient privileges execption. Can anyone helpe me with a sample code or example to run the application on user's desktop with admin privileges? Or if I am doing wrong, can anyone suggest me the right way of doing it?
I currently face this problem in Windows XP. I suppose in Windows Vista or 7, it (executing with admin previleges) would require elevated permissions.