ConsoleColor color = Console.ForegroundColor;
ProcessStartInfo startinfo = new ProcessStartInfo(nameProgramB);
startinfo.CreateNoWindow = false;
startinfo.UseShellExecute = false;
Process p = Process.Start(startinfo);
p.WaitForExit();
Console.ForegroundColor = color;