Hi,
Can any one help me out in executing this code
string command = @" tf help > tfshistory.txt";
System.Diagnostics.ProcessStartInfo procStartInfo =
new System.Diagnostics.ProcessStartInfo(@"cmd", @" C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" + 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();
// Display the command output.
Console.WriteLine(result);
MessageBox.Show(result);
Thanks,
Prakash
Loading

Sam HobbsPosted Sep 16, 2011, 12:45 AM
If none of the replies so far have helped you, then you need to clarify what you need help with or what the problem is that you are trying to solve.
VulpesPosted Sep 15, 2011, 8:33 AM