0

when the key is pressed, the code below runs as it should, but brings up a CommandPromt window.
now, i want to display the result in a text box.. how to do it?

private void Button1_Click(object sender, EventArgs e)
    {
        var process = new Process();
        var startInfo = new ProcessStartInfo
        {
            WorkingDirectory = @"mysql-8.0.30-winx64\bin",
            WindowStyle = ProcessWindowStyle.Normal,
            FileName = "cmd.exe",
            RedirectStandardInput = true,
            UseShellExecute = false
        };
        process.StartInfo = startInfo;
        process.Start();
        process.StandardInput.WriteLine("mysqld --initialize --console");
        process.WaitForExit();
    }

Thank you

Philipe
  • 29
  • 6
  • [How do I get output from a command to appear in a control on a Form in real-time?](https://stackoverflow.com/a/51682585/7444103), in case you may need a different approach – Jimi Nov 11 '22 at 11:27

0 Answers0