Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 921603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:53:44+00:00 2026-05-15T18:53:44+00:00

I’m running a process from inside a windows service using: ProcessStartInfo processStartInfo = new

  • 0

I’m running a process from inside a windows service using:

ProcessStartInfo processStartInfo = new ....
Process.Start(processStartInfo);

The problem is, if I run service under local system account, it runs alright, but it doesn’t show the programs’ window. I’ve tried to put user credentials in service properties, but then ‘Allow service to interact with desktop’ checkbox becomes disable.

I really need to run the app calling it from service, and I really need to see the app’s window.

Update 1:

Well, you use overloaded version of Process.Start what takes username, password and domain – it will pull the program to the desktop. But, now it starts the app under one credentials, and shows that on a different user’s desktop. How come?

Update 2:

I have an idea! I can use psexec.exe from Sysinternals Suite. But, the problem is, I need to start that thing silently "as administrator", which I don’t know how to do it.

I mean even, if you’re already have admin rights, sometimes you have to manually say "run as administrator", confirm UAC and only after that you’re ready to go. I don’t know how silently run something without bringing UAC thing…

Update 3:

Dear Lord. I’ve got that thing! Finally!

In the beginning the problem was indeed in session 0 isolation thing. So, I needed to build a middle app that can be started from the service and then, that app in its turn suppose to start my application through RPC and bring it to a desktop. Instead of building middle layer app I decided to use psexec.exe tool (anyway it works exactly the way I need – through RPC).
And, when I tried to use that tool under LOCAL SYSTEM account it didn’t work for some reason. And then I realized – the reason is damn EULA popup dialog that MS put in every single pstool, and it was impossible to click the button to confirm dialog under LOCAL SYSTEM account.

So, the solution is to create a key in the registry HKU\.DEFAULT\Software\Sysinternals\PsExec with DWORD value EulaAccepted = 1.

Hooray, now it works!
BUT! Now I need to bring the program to the currently logged user’s screen. To do that I’m gonna need the session id!

So the question is :

How to get currently logged user’s session id? And, what happens if there’s no one logged yet? What session id that would be?

Update 4:

That’s it! I got that one!

[DllImport("Kernel32.dll", EntryPoint = "WTSGetActiveConsoleSessionId")]
public static extern int WTSGetActiveConsoleSessionId();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:53:44+00:00Added an answer on May 15, 2026 at 6:53 pm

    One solution would be to have a third process act as an intermediary, and tell it to launch apps via RPC/Named pipes.

    Processes:

    • Windows service
    • Intermediary application
    • The app you want to run

    The shim creates a communication endpoint (named pipe, WCF endpoint) and listens on it. When it gets a message to go ahead, it launches the app you want to run.

    Then, when the Windows service wants to launch an app, it finds and opens the endpoint (named pipe, WCF endpoint), and sends the message to launch the app. Then the intermediary application takes care of the process launching business, and doesn’t have any of the limitations that the Windows service has.

    Make this intermediary process start with logon, and you’re good to go.

    This is similar to how the Microsoft test agent/controller work when you need to run tests that interact with the desktop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 509k
  • Answers 509k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Have a look at: AnythingSlider You can put anything images,… May 16, 2026 at 4:49 pm
  • Editorial Team
    Editorial Team added an answer In XML, it would look something like this: style="?header_background" programmatically,… May 16, 2026 at 4:48 pm
  • Editorial Team
    Editorial Team added an answer You're encountering Scala's path-dependent types. your val y: InnerTrait's type… May 16, 2026 at 4:48 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am currently running into a problem where an element is coming back from
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.