How to open cmd.exe on button click using IIS Server .
I know,
Process.Start("cmd.exe");
Thanks
Open cmd.exe on button click using IIS Server .
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
SenthilkumarRank #387 · 6.5K pointsPosted Apr 17, 2012, 1:28 AM EDT
Try this...
new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command); // The following commands are needed to redirect the standard output. // This means that it will be redirected to the Process.StandardOutput StreamReader. procStartInfo.RedirectStandardOutput = true; procStartInfo.UseShellExecute = false; // Do not create the black window. procStartInfo.CreateNoWindow = true; // Now we create a process, assign its ProcessStartInfo and start it System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo = procStartInfo; proc.Start(); // Get the output into a string string result = proc.StandardOutput.ReadToEnd();indramani gautam81 pointsPosted Apr 17, 2012, 8:06 PM EDT