I have a button that uses Process.Start to initiate a process along with a parameter, although how could you let the user define this parameter (“C:\Documents”), e.g. possibly a text box that a user enters it in and then directs the input into the command?
Code so far:
private void button1_Click_1(object sender, EventArgs e)
{
Process.Start("increase.exe", "C:\\Documents");
}
Assuming the existence of a
myTextBoxtextbox on the form, you simply access itsTextattribute to retrieve the value:Of course, without validating that this is an existing path (and the user has permissions to it), you will get an exception.