A
anandjoshi77
Hi All,
I have a Asp.Net web application (code behind C#).
On one page I need to run "cmd.exe" from that page.
I can see that the "cmd.exe" is present in the task manager, but the
console window is not opening.
As I can not process further unless that window is opened, I'm stuck.
I'm trying to run this on Windows XP machine.
For a try I'm using this simple form with one button on it.
On click of button, I'm executing following code.
ProcessStartInfo info = new ProcessStartInfo("cmd.exe");
info.UseShellExecute = false;
info.RedirectStandardInput = true;
info.RedirectStandardError = true;
info.RedirectStandardOutput = true;
using (Process install = Process.Start(info))
{
string output = install.StandardOutput.ReadToEnd();
install.WaitForExit();
Console.WriteLine(output);
}
I'm badly stuck. Please help.
Anand
I have a Asp.Net web application (code behind C#).
On one page I need to run "cmd.exe" from that page.
I can see that the "cmd.exe" is present in the task manager, but the
console window is not opening.
As I can not process further unless that window is opened, I'm stuck.
I'm trying to run this on Windows XP machine.
For a try I'm using this simple form with one button on it.
On click of button, I'm executing following code.
ProcessStartInfo info = new ProcessStartInfo("cmd.exe");
info.UseShellExecute = false;
info.RedirectStandardInput = true;
info.RedirectStandardError = true;
info.RedirectStandardOutput = true;
using (Process install = Process.Start(info))
{
string output = install.StandardOutput.ReadToEnd();
install.WaitForExit();
Console.WriteLine(output);
}
I'm badly stuck. Please help.
Anand