How to Execute a Program Which accepts Command Line Parameters in c#?
Use the Start method of the Process class.
Starts a process resource by specifying the name of an application and a set of command-line arguments, and associates the resource with a new Process component.
Example:
Process.Start("IExplore.exe", "C:\\myPath\\myFile.htm");
ProcessStartInfo Class
ProcessStartInfo is used together with the Process component. When you start a process using the Process class, you have access to process information in addition to that available when attaching to a running process.
ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
startInfo.Arguments = "www.northwindtraders.com";
Process process = Process.Start(startInfo);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With