Calling another application in C#

Include System.Diagnostics namespace.

Process proc = null;
ProcessStartInfo procInfo = new ProcessStartInfo("Notepad.exe");
procInfo.UseShellExecute = false;
proc = Process.Start(procInfo);

Create objects for Process and ProcessStartInfo.

In ProcessStartInfo specify the application to run.

procInfo.UseShellExecute = false;

this line is to indicate whether to use the operating system shell to start the process.Default value is true.

procInfo.CreateNoWindow = true;

Indicates to start the process in new window.

proc = Process.Start(procInfo);

It will start the process and wait indefinitely for the process to exit.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.