Hi
I want to know if it is possible to execute a exe from within C#. Say for instance you click on a button it should open notepad?
Is there also a way of checking that the process is still alive? If I want to execute another program after notepad is close how will I do it? In other words if I close notepad I want my C# program to execute another exe file.
Is it possible? I'm quite new to OO.
Best regards
Louis
Executing a .exe or .bat file from within C#
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Nirlep KaurRank #8,900 · 214 reputationPosted Nov 16, 2005, 1:21 AM EST
Process p;
private
void button1_Click(object sender, System.EventArgs e){
p=Process.Start("Notepad.exe");
}
private void button2_Click(object sender, System.EventArgs e){
if(p.HasExited){
Process.Start("winword.exe");
}
}
Louis10 reputationPosted Nov 23, 2005, 8:22 PM EST
This is working perfectly!!