Passing Text for command line

Posted by Kasun on Stack Overflow See other posts from Stack Overflow or by Kasun
Published on 2010-06-15T16:24:49Z Indexed on 2010/06/15 16:42 UTC
Read the original article Hit count: 300

Filed under:
|

Hi, I need to pass some text which is in richtext box to command line. This is my Button click even which start the cmd.

    private void button1_Click(object sender, EventArgs e)
    {
        ProcessStartInfo psi = new ProcessStartInfo
        {
            FileName = "cmd",
            Arguments = @"/k ""C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat""",
        };
        Process.Start(psi);            
    }

In my rich text box contain following text.

include iostream

using namespace std;

int main()
{
    cout << "Welcome to the wonderful world of C++!!!\n";

    return 0;
}

Can anyone provide me necessary codes.

© Stack Overflow or respective owner

Related posts about c#

Related posts about c++