Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Fonte Link

Utilize um StreamWriter para mandar vários comandos em sequência:

Process p = new Process();
    ProcessStartInfo info = new ProcessStartInfo();
    info.FileName = "cmd.exe";
    info.RedirectStandardInput = true;
    info.UseShellExecute = false;

    p.StartInfo = info;
    p.Start();

    using (StreamWriter sw = p.StandardInput)
    {
        if (sw.BaseStream.CanWrite)
        {
            sw.WriteLine("IPCONFIG");
            sw.WriteLine("OPENSSL");
        }
    }

Fonte: http://stackoverflow.com/questions/437419/execute-multiple-command-lines-with-the-same-process-using-nethttps://stackoverflow.com/questions/437419/execute-multiple-command-lines-with-the-same-process-using-net

Utilize um StreamWriter para mandar vários comandos em sequência:

Process p = new Process();
    ProcessStartInfo info = new ProcessStartInfo();
    info.FileName = "cmd.exe";
    info.RedirectStandardInput = true;
    info.UseShellExecute = false;

    p.StartInfo = info;
    p.Start();

    using (StreamWriter sw = p.StandardInput)
    {
        if (sw.BaseStream.CanWrite)
        {
            sw.WriteLine("IPCONFIG");
            sw.WriteLine("OPENSSL");
        }
    }

Fonte: http://stackoverflow.com/questions/437419/execute-multiple-command-lines-with-the-same-process-using-net

Utilize um StreamWriter para mandar vários comandos em sequência:

Process p = new Process();
    ProcessStartInfo info = new ProcessStartInfo();
    info.FileName = "cmd.exe";
    info.RedirectStandardInput = true;
    info.UseShellExecute = false;

    p.StartInfo = info;
    p.Start();

    using (StreamWriter sw = p.StandardInput)
    {
        if (sw.BaseStream.CanWrite)
        {
            sw.WriteLine("IPCONFIG");
            sw.WriteLine("OPENSSL");
        }
    }

Fonte: https://stackoverflow.com/questions/437419/execute-multiple-command-lines-with-the-same-process-using-net

Fonte Link
OnoSendai
  • 37mil
  • 3
  • 68
  • 120

Utilize um StreamWriter para mandar vários comandos em sequência:

Process p = new Process();
    ProcessStartInfo info = new ProcessStartInfo();
    info.FileName = "cmd.exe";
    info.RedirectStandardInput = true;
    info.UseShellExecute = false;

    p.StartInfo = info;
    p.Start();

    using (StreamWriter sw = p.StandardInput)
    {
        if (sw.BaseStream.CanWrite)
        {
            sw.WriteLine("IPCONFIG");
            sw.WriteLine("OPENSSL");
        }
    }

Fonte: http://stackoverflow.com/questions/437419/execute-multiple-command-lines-with-the-same-process-using-net