I already did; but when executing the following code, i get a
System.InvalidOperationException: StandardOut has not been redirected.
System.Diagnostics.Process myP = System.Diagnostics.Process.Start("cmd",
@"/C dir C:\");
Response.Output.Write(myP.StandardOutput.ReadToEnd ());
Thnx in advance...
"dave wanta" <no****@nospam.com> wrote in message
news:O3*************@TK2MSFTNGP10.phx.gbl...
You want to look at the System.Diagnostics.Process namespace.
Cheers!
Dave
www.aspNetEmail.com
"Allan Rojas" <nd****@thecqgl.com> wrote in message
news:en**************@tk2msftngp13.phx.gbl... Hi,
I want to execute a shell command and retrieve the output of it, is
there a method to do it? All i have found is how to start a process (cmd /C),
but i cannot retrieve the result of the command execution.
For example, it would be ideal if there would be a method like:
string result = ExecuteShellCommand("dir *.txt");
thnx in advance...