Mit dem System.Diagnostics Namespace.
using (Process process = new Process())
{
ProcessStartInfo startInfo = new ProcessStartInfo
{
FileName = "cmd.exe",
Arguments = "/c ipconfig",
RedirectStandardOutput = true,
RedirectErrorOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
process.StartInfo = startInfo;
process.Start();
process.WaitForExit();
using (StreamReader reader = process.StandardOutput)
{
return reader.ReadToEnd();
}
}