Running Command Line from C# without Window and Getting Output
<p>I am trying to run a command line script from C#. I want it to run without a shell and place the output into my string output. It doesn't like the p.StartInfo line. What am I doing wrong? I am not running a file like p.StartInfo.FileName = "YOURBATCHFILE.bat" like <a href="https://stackoverflow.com/questions/206323/how-to-execute-command-line-in-c-get-std-out-results">How To: Execute command line in C#, get STD OUT results</a>. I need to set the "CMD.exe" and command line string. I have tried p.Start("CMD.exe", strCmdText); but that gives me the error: "Memer 'System.Diagnostics.Process.Start(string,string)' cannot be accessed with an instance reference; qualify it with a type name instead."</p>

<pre><code>    string ipAddress;
    System.Diagnostics.Process p = new System.Diagnostics.Process();
    p.StartInfo.UseShellExecute = false;
    p.StartInfo.RedirectStandardOutput = true;
    string strCmdText;
    strCmdText = "tracert -d " + ipAdress;
    p.StartInfo("CMD.exe", strCmdText);
    string output = p.StandardOutput.ReadToEnd();
    p.WaitForExit();
</code></pre>