I am coding a c# winform app which runs minecraft using cmd and logs live output to a textbox, like a console in minecraft launcher (btw minecraft logs output to cmd), there are some posts about this but nothing works for me.
Edit : It doesnt runs the command but close it still runs the cmd, not the command though
What i've tried:
string Username = Username_box.Text;
string RamAmout = Ram_Amout.Text;
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.FileName = "cmd.exe";
// startInfo.WindowStyle = ProcessWindowStyle.Hidden;
// startInfo.Arguments = "/C echo nothing";
process.OutputDataReceived += (s, e) => { ConsoleLog.Text = e.Data; };
process.StartInfo = startInfo;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.Start();
process.BeginOutputReadLine();
process.StandardInput.WriteLine("cd bin & cd clients & cd mcsave & ..\\azul-java\\bin\\java.exe -noverify -Xms" + RamAmout + "g " + " -Xmx" + RamAmout + "g " + "-Djava.library.path=..\\1.8.9-natives -cp \"..\\189\\vanilla.jar;lwjgl.jar;lwjgl_util.jar\" net.minecraft.client.main.Main -uuid fc5bc365-aedf-30a8-8b89-04e462e29bde -accessToken yes -version 1 --username " + Username");
process.WaitForExit();