Managing Processes
You use the System.Diagnostics.Process class to manage processes on your machine.
This class offers both shared and instance members so that you can launch an external process but also get a reference to one or more processes. The following code shows how to launch an external process via the shared implementation of the Start method:
Process.Start("Notepad.exe")
Any call to the Process.Start method will return a Process object. You can also specify arguments for the process by specifying the second parameter for the method as follows:
Process.Start("Notepad.exe", "C:\aFile.txt")
One of the most important features of the Start method is that you can also supply the username, password, and domain for launching a process:
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access