Το βρήκα με Process,
System.Diagnostics.ProcessStartInfo sinf =
new System.Diagnostics.ProcessStartInfo("cmd", "dir c:\");
// The following commands are needed to redirect the standard output. This means that it will be redirected to the Process.StandardOutput StreamReader.
sinf.RedirectStandardOutput = true;
sinf.UseShellExecute = false;
// Do not create that ugly black window, please...
sinf.CreateNoWindow = true;
// Now we create a process, assign its ProcessStartInfo and start it
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo = sinf;
p.Start(); // well, we should check the return value here...
// We can now capture the output into a string...
string res = p.StandardOutput.ReadToEnd();
Ευχαριστώ
"Success is the ability to go from one failure to another with no loss of enthusiasm."
Winston Churchill
"Quality means doing it right when no one is looking."
Henry Ford