Reputation: 13
I wanted to run local desktop applications which are installed in Program Files and Program File (x86) folders only, the application should run with administrator privileges as logged in user context. I have googled and got to know some.
Required as per my idea:-
Note: The communication between File Explorer will happen using socket client and server. The service will launch the local application server in system context.
Imagine that File Explorer, Service and Application Launching server are installed. Using File explorer the app will be selected and selected application information will be sent to the server. The server will do check on the requested path whether it is from trusted path or not.
If it is from trusted path, the server will get handle from "winlogon.exe" and get the handle to the access token, then duplicate the access token and adjust its privileges (default system privilege will be there and i don't want that as system will have full privileges) then use CreateProcessAsUser to launch the application.
Once launched bring the UI to the foreground. The application need to be run in user context with administrator privileges.
My questions are stated below:-
The targeted OS is Windows 10 1803 and 1809.
Upvotes: 0
Views: 292
Reputation: 17288
Have a look for the tools psexec
or paexec
(they're mostly identical, the major difference being that the later is open-source).
These tools allow you to start a process as another user and/or on another computer. This should work from a service as well.
Upvotes: 0