Running an external program
-
Hello, How can i get a bit of C# code to launch an external program (for instance notepad) ? Regards, Tariq
System.Diagnostics.Process.Start ("notepad.exe");
Check out the documentation on the
System.Diagnostics.Process
class for more info... Andreas Philipson -
System.Diagnostics.Process.Start ("notepad.exe");
Check out the documentation on the
System.Diagnostics.Process
class for more info... Andreas PhilipsonThanks for the information. Appreciate it:) But I still have one doubt. That is, how do i pass parameters to the application I am trying to run. eg . notepad test1.txt I tried giving it in the file name - but that doesnt work. I couldnt find any other relevant property to achieve this. Can you help? Regards, Tariq
-
Thanks for the information. Appreciate it:) But I still have one doubt. That is, how do i pass parameters to the application I am trying to run. eg . notepad test1.txt I tried giving it in the file name - but that doesnt work. I couldnt find any other relevant property to achieve this. Can you help? Regards, Tariq
using System.Diagnostics;
ProcessStartInfo notepad = new ProcessStartInfo ("notepad.exe", "C:\\SomeFile.txt");
Process.Start (notepad);:) Andreas Philipson