cotopboy
11/11/2013 - 9:07 AM

Start Process with parameters.

Start Process with parameters.



starter.exe
var process = new Process
{
    StartInfo = new ProcessStartInfo
    {
        FileName = "target.exe",
        Arguments = "xxxx xxxx xxxx",
        WindowStyle = ProcessWindowStyle.Hidden
    }
};
process.Start();
process.WaitForExit();
MessageBox.Show("Test");



/////////////////////////////////////
/////////////////////////////////////
////////////////////////////////////

target.exe
static void Main(string[] args)
{

    Console.WriteLine("Start");
    Thread.Sleep(5000);

    foreach (var item in args)
    {
        Console.WriteLine(item);
    }

    Console.WriteLine("Done");

}