77vetter
77vetter

Reputation: 193

Start process and allow caller to end without waiting for process to finish

I need to start a process from a C# console app and then allow the console app to finish/end without waiting for the process/thread to finish.

How do I do this?

Upvotes: 10

Views: 10428

Answers (2)

Hans Karlsen
Hans Karlsen

Reputation: 2435

You need to avoid making your new process a child process of the current process:

ProcessStartInfo sinfo = new ProcessStartInfo();
sinfo.UseShellExecute = true; // Do not wait - make the process stand alone
sinfo.FileName = "PathAndNameofExe";
Process.Start(sinfo);

Upvotes: 9

Servy
Servy

Reputation: 203814

Process.Start("TheNameOfTheOtherProcess.exe");

Upvotes: 0

Related Questions