Run process as administrator from Windows service

I am working on a sample as I have a windows service that starts a process (UserApplication.exe). To start a Windows service form I got a sample of this link http://www.codeproject.com/Articles/35773/Subverting-Vista-UAC-in-Both-32-and-64-bit-Archite .

This works great. But the problem is that the running process (UserApplication.exe) is calling the FilterAttach () API. When this process (UserApplication.exe) calls this API then it fails with - access denied.

But if I start the same process (UserApplication.exe) by right clicking and running it as admin then it works fine without error and everything works fine.

please let me know how to start the process as an administrator creating the service.

Also I tried to set the manifest file of this exe to run as admin but without help ( http://msdn.microsoft.com/en-us/library/bb384691.aspx )

+3


source to share





All Articles