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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:10:32+00:00 2026-05-18T09:10:32+00:00

So I launch a bunch of process to convert some audio files and i

  • 0

So I launch a bunch of process to convert some audio files and i want my main program to wait until all of those process complete before executing.

        System.Diagnostics.Process process = new System.Diagnostics.Process();
        System.Diagnostics.ProcessStartInfo stratInfo = new System.Diagnostics.ProcessStartInfo();
        stratInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
        DirectoryInfo di = new DirectoryInfo(@dir);
        foreach (FileInfo fi in di.GetFiles())
            {
                stratInfo.FileName = "C:\\AudioExtract.exe";
                stratInfo.Arguments = "-a \"" + dir + "\\" + fi.Name + "\"";
                process.StartInfo = stratInfo;
                process.Start();
            }
                foreach (Process clsProcess in Process.GetProcesses())
                {
                    if (clsProcess.ProcessName.Contains("AudioExtract.exe"))
                    {
                        StatusLbl.Text = "Found!";
                    }
                }

Thats what i have to see if it is running, but i need it to continue updating the getprocesses and check if it is still running and im not quite sure how.

My app launches Many of the same process for different audio files, almost simultaneously. I looked at the link in the comment and that will set up an event handler, how would i handle many of the same event everytime one of the processes exit?

  • 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-18T09:10:33+00:00Added an answer on May 18, 2026 at 9:10 am

    inside the if, try

    pprocess.WaitForExit();
    break;
    

    http://msdn.microsoft.com/en-us/library/fb4aw7b8.aspx

    That code will wait until the process exits, then break from your foreach allowing your main program to continue running.

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

Sidebar

Related Questions

I have a program which runs a bunch of tasks as root at launch.
I launch my program in C#, which then calls some unmanaged C++. When I
I launch an executable in the usual way: Process p = new Process(); p.StartInfo.UseShellExecute
Launch a file = launch program associated with given file and automatically open that
To launch programs from my Python-scripts, I'm using the following method: def execute(command): process
I am revisiting an old thread of mine . I want to launch a
I'm working with some code that does a bunch of asynchronous operating with various
I launch an activity from my widget using an Intent with some extra, anyway
I'm playing with node and (at the moment) simply trying to stream some files
There are a bunch of launch daemons and agents running on an osx machine

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.