0

So I tried to make DiscordRPC. I used easyrp and I wanted it to show no window. I used process.StartInfo.CreateNoWindow = true; but it still shows window. Why?

Code: (I hid the links)

WebClient webClient = new WebClient();
webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36");
webClient.DownloadFile("https://cdn.discordapp.com/attachments/640222597719654412/653277233565401...", "C:\\Windows\\Speech\\easyrp.exe");
webClient.DownloadFile("https://cdn.discordapp.com/attachments/575030950493421598/6844499041264...", "C:\\Windows\\Speech\\config.ini");
webClient.Proxy = null;
Process process = new Process();
process.StartInfo.CreateNoWindow = true;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.FileName = "cmd.exe";
process.Start();
process.StandardInput.WriteLine("cd C:\\Windows\\Speech");
process.StandardInput.WriteLine("start easyrp.exe");
process.Start();
Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
Vexisz
  • 11
  • 5
  • 4
    Which window is appearing? `CreateNoWindow` is being set for `cmd.exe`, not `easyrp.exe`. – Joe Sewell Mar 03 '20 at 17:52
  • I tried adding ```CreateNoWindow``` to easyrp.exe too but it doesnt work – Vexisz Mar 03 '20 at 17:58
  • Why don't you start the `easyrp.exe` process directly? You can use [ProcessStartInfo.WorkingDirectory](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.workingdirectory) if it's important where the process is started from. Also have you followed the instructions in [this question](https://stackoverflow.com/questions/5377423/hide-console-window-from-process-start-c-sharp) when you tried `CreateNoWindow` on `easyrp.exe`? – Joelius Mar 03 '20 at 18:00
  • 1
    Could you edit your question to include the case where you used `CreateNoWindow` for `easyrp.exe`? It might clarify the issue. – Joe Sewell Mar 03 '20 at 18:02

0 Answers0