I am having an issue regarding the process class in c#, specifically when trying to start the command prompt. What occurs is that an infinite amount of cmd windows open, then infinitely close as if caught in a loop, despite the fact that there is none; it literally freezes my computer when run. This however, ONLY occurs on my 64 bit vista; the code (which I will post shortly) works totally fine on my 32bit lenovo thinkpad, and I can't figure out why. Note that the standard output lines are not what is causing the issue; I tried removing them, with no luck. Any ideas would be much appreciated.
using System;
using System.Windows.Forms;
using System.Diagnostics;
public class BuildByteArray
{
public static void Main()
{
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/c ipconfig";
MessageBox.Show("");
process.StartInfo = startInfo;
process.Start();
string output = process.StandardOutput.ReadToEnd();
MessageBox.Show(output);
process.WaitForExit();
}
}