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 8011153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:56:47+00:00 2026-06-04T18:56:47+00:00

All, I am developing an application that needs to launch another application at run-time.

  • 0

All, I am developing an application that needs to launch another application at run-time. To launch the third-party app I am using System.Diagnostics.Process and to ensure I never launch the third-party application twice I employ a singleton pattern.

The singleton is working is required, but Process.Start() method is not. That is although I am getting the same Process object returned from the singleton, Start() is launching another instance of the third-part app.

From MSDN – Process.Start() page:

"Starts (or reuses) the process resource that is specified by the StartInfo property 
of this Process component and associates it with the component."

suggest that it should reuse the instance of the Process. What am I missing?

Thanks for your time.

  • 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-06-04T18:56:48+00:00Added an answer on June 4, 2026 at 6:56 pm

    Here is the function I use to start third party applications:

        public static void ProcessStart(string ExecutablePath, string sArgs, bool bWait)
        {
            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.EnableRaisingEvents = false;
            proc.StartInfo.FileName = ExecutablePath;
    
            if(sArgs.Length > 0)
                proc.StartInfo.Arguments = sArgs;
    
    
            proc.Start();
    
            if(bWait)
                proc.WaitForExit();
    
            if(ProcessLive(ExecutablePath))
                return true;
            else
                return false;               
    
        }
    

    ExecutablePath: Full path to the executable

    sArgs: Command line arguments

    bWait: Wait for the process to exit

    In my case I use a secondary function to determine if the process is already running. This is not exactly what you are looking for, but it will still work:

        public static bool ProcessLive(string ExecutablePath)
        {
            try
            {
    
                string strTargetProcessName = System.IO.Path.GetFileNameWithoutExtension(ExecutablePath);
    
                System.Diagnostics.Process[] Processes = System.Diagnostics.Process.GetProcessesByName(strTargetProcessName);
    
                foreach(System.Diagnostics.Process p in Processes)
                {
                    foreach(System.Diagnostics.ProcessModule m in p.Modules)
                    {
                        if(ExecutablePath.ToLower() == m.FileName.ToLower())
                            return true;
                    }
                }
            }
            catch(Exception){}
    
            return false;
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an application that needs to constantly run a service unless the
First, some background: I'm developing a web application using Python. All of my (text)
I'm currently developing an application which needs a lot of system and process information,
I'm developing an application using ASP.Net. For first the idea: My WebApp needs an
I have an application which I am developing using WPF\Prism\MVVM. All is going well
I'm developing an application that needs to store lots of records in an organized
I am developing an application that needs to work on Linux, Windows and Mac
I am developing a commercial VB.net WPF application that needs user generated scripts for
I am developing a PC WinForms application in C# that needs to connect to
I have a Windows Phone application I am developing that needs to persist some

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.