I want to execute process of cmd.exe
only once outside foreach
and inside foreach want to send parameters to this process.
I am currently doing this:
var msbuildPath = (string) regKey.GetValue("MSBuildToolsPath");
foreach (var item in listBox1.Items)
{
var FilePath = item.ToString();
var startInfo = new ProcessStartInfo()
{
WindowStyle = ProcessWindowStyle.Hidden,
Arguments = String.Format("\"{0}\" /nologo ", FilePath),
FileName = Path.Combine(msbuildPath, "msbuild.exe")
};
var proc = Process.Start(startInfo);
proc.WaitForExit();
}
If I get you right, it should look something like this: