Click here to Skip to main content
15,065,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a small Windows form application to close all game apps after a certain amount of time, but I can't do a command to close the open and soon to be enabled application.  Hope everyone help me

What I have tried:

I don't know the command to close all apps on the desktop.
Updated 30-Nov-20 9:00am

1 solution

You can't close them all in one command, you have to identify the processes and kill each of them one by one.

Process.GetProcessesByName Method (System.Diagnostics) | Microsoft Docs[^]
Process.Kill Method (System.Diagnostics) | Microsoft Docs[^]

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