internal static void Exec(StrawberryPerl perl, string command, string path_env) { Console.WriteLine("Perl-" + perl.Name + "\n=============="); process = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.WindowStyle = ProcessWindowStyle.Hidden; System.Environment.SetEnvironmentVariable( "PATH", String.Join(";", perl.PerlPath, path_env) ); startInfo.FileName = "cmd.exe"; startInfo.Arguments = "/c " + perl.PerlPath + @"\" + command; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.UseShellExecute = false; process.Start(); Console.WriteLine(process.StandardOutput.ReadToEnd()); Console.WriteLine(process.StandardError.ReadToEnd()); process.WaitForExit(); }