How do you program a windows service in C# to start an application for a user?

Posted by Swoop on Stack Overflow See other posts from Stack Overflow or by Swoop
Published on 2010-03-23T20:02:14Z Indexed on 2010/03/23 20:13 UTC
Read the original article Hit count: 229

Filed under:
|
|

Is it possible to start a program so that it is available to a user with a windows service? I have been working with the Process.Start() in C#. I can get the service to kickoff some sort of process that appears in the Task Manager list under processes. However, the program nevers appears on the screen. By default, it runs under the user name "SYSTEM". I have adjusted the "Log On" option in the service manager to match the person logged into the computer, but this does not cause a window to appear either.

I feel like I am either missing a simple setting, or need to take a different direction for this. Below is the code I have been working with to start up Firefox as a test app.

    private void startRunDap()
    {
        ProcessStartInfo startInfo = new ProcessStartInfo();
        startInfo.FileName = "Firefox";
        startInfo.WindowStyle = ProcessWindowStyle.Normal;
        startInfo.UseShellExecute = true;
        Process.Start(startInfo);

        //Process.Start("Firefox");

    }

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET