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

  • SEARCH
  • Home
  • 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 6839155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:41:03+00:00 2026-05-26T23:41:03+00:00

Well, Im trying to spawn a process from inside a thread spawned by a

  • 0

Well, Im trying to spawn a process from inside a thread spawned by a Windows Service. The goal being to read the output and printing to the window in focus — where cursor is. Probably a bad idea, I don’t know i’m not a c# programmer

Anywho spawning the process works when I call the function itself, but not when it’s called inside a running service. Is starting a process inside a service possible?

Process proc = new Process();
                proc.StartInfo.FileName = @"C:\file.bat";
                proc.StartInfo.RedirectStandardError = true;
                proc.StartInfo.RedirectStandardOutput = true;
                proc.StartInfo.UseShellExecute = false;

                proc.Start();

                String outputMessage = proc.StandardOutput.ReadToEnd();
                proc.WaitForExit();
  • 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-26T23:41:03+00:00Added an answer on May 26, 2026 at 11:41 pm

    Starting a process from a service is certainly possible. However, services run inside session 0 and have no desktop. Interactive users run their desktops in a different session. Consequently it is very challenging to get a process up and running inside an interactive session when starting from a service.

    For an illustration of the issues involved, and how tricky it is to get right, read this: Launching an interactive process from Windows Service in Windows Vista and later.

    The simplest approach would be to separate your service into two distinct parts. One part runs as a service, and the other part runs as a windowless process in the interactive session. These two processes can communicate by whatever IPC mechanism you prefer. When the service wants to start a process it simply sends a message to its other half in the interactive session to request that the new process is started.

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

Sidebar

Related Questions

Well, I was trying to select rows from one table if there are no
I am trying to run daemon process using daemon-spawn gem. Here is the code
well iam trying to get version of IE used by user by using $.browser.version
Well I am trying to submit a form by pressing enter but not displaying
Well,I am trying to do something similar what I did in Adobe Flex.Consuming a
When trying to link some well established tools to my company's active directory, I
I'm trying to learn Ruby as well as Ruby on Rails right now. I'm
I was trying the ASP.NET login control tutorial and everything works well. However, I
Well, here's a nice obscure one. I'm trying to compile the latest open transport
I'm trying to display frequencies within barplot ... well, I want them somewhere in

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.