Because of security reasons creating a new process from Windows service isn't a simple task especially if you need to run an application with GUI on Windows 2008/Windows Vista/Windows 7 under specific user account.
DevxExec is designed exactly to run application from a windows service. Using DevxExec you can run applications from your service under Local System, Network Service or a specific user account.
There is even possibility to specify a session for the running application. Thus when multiple users connected to the computer via remote desktop you can specify on which desktop the application should be started.
It has command line interface. To see the help, run DevxExec with no parameters.
DevxExec is free for noncommercial usage.
DevxExec.exe /user: Administrator /password:qwerty cmd.exe
devxexec.exe desktop:winsta0\winlogon
This command automatically grant to user Administrator permissions on the appropriate window station and the desktop and run a command shell.
Let's consider following scenario. You have a Windows service running. User John Doe has logged to the computer. And you want your service to start the application that will be shown to John Doe on his current desktop. In other words, you need to run a new process in another session.
Again you can use DevxExec. It has a special parameter /sessionid to specify the session you what to run a new process in. For example this command could start a command shell for a logged in user under Administrator.
DevxExec.exe /user: Marcus /password:qwerty /sessionid:1 cmd.exe
Devxexec is the tool the allowing running processes under different user accounts without knowing the password.
It is even possible to run a process under domain account without specifying its password!
You can use Devxexec to run a process under SYSTEM, NETWORK_SERVICE, TrustedInstaller in an interactive session.
Full Specifications
What's new in version 1.16
Version 1.16 allows you to select desktops to run applications: devxexec.exe desktop:winsta0\winlogon.
General
ReleaseJanuary 26, 2014
Date AddedJanuary 26, 2014
Version1.16
Operating Systems
Operating SystemsWindows 2003, Windows Vista, Windows, Windows 2000, Windows 8, Windows Server 2008, Windows 7, Windows XP