Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a launcher in c# that't open a game but i want to kill conhost before open the game but when it's trying to close conhost the launcher crash

What I have tried:

i have try the default command
Process[] a = Process.GetProcessesByName("conhost");
                 foreach (Process p in a)
                 {
                     p.Kill();         

                 }
Posted
Updated 13-Nov-20 2:34am

1 solution

Let me guess - your code is running as a console application.

When you kill the console host process, you kill your console application.

It sounds like you're trying to cheat or hack the game. We do not condone such activities, and will not help you perform them.
 
Share this answer
 
Comments
nickstam2 13-Nov-20 8:38am    
no i run my application in exe file i am trying to open a game with that and prevent an inject hacking game to this game (the hacks that allready exist they are using conhost)
Richard Deeming 13-Nov-20 8:40am    
Then it's probably the case that your application doesn't have permission to kill conhost. But without the exception details, we're just guessing.
nickstam2 13-Nov-20 8:42am    
ok so how i am suppose to give permision to kill the conhost.exe without make my application run us administrator ?
Richard Deeming 13-Nov-20 8:43am    
You can't. If you could, that would defeat the whole point of UAC.
nickstam2 13-Nov-20 8:53am    
Ok thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900