The fastest native solution seems to be Win + Tab and then middle-click the Apps to close them.
The best 3rd party solution I found is 7+ Taskbar Tweaker. You can configure it to close Tasks by middle-click to the tasks entry immediately in the task bar. Unfortunately, Taskbar Tweaker seems to be tailor-fit very closely to Windows and broke with every major update (Anniversary, Creator). The maintainer each time fixed it within some weeks, but meanwhile everything defaults to the old behavior of opening new instances instead of closing old ones.
Answer from Sascha on Stack ExchangeThe fastest native solution seems to be Win + Tab and then middle-click the Apps to close them.
The best 3rd party solution I found is 7+ Taskbar Tweaker. You can configure it to close Tasks by middle-click to the tasks entry immediately in the task bar. Unfortunately, Taskbar Tweaker seems to be tailor-fit very closely to Windows and broke with every major update (Anniversary, Creator). The maintainer each time fixed it within some weeks, but meanwhile everything defaults to the old behavior of opening new instances instead of closing old ones.
In my case, I simply open the task manager, then in the tab Application, I select the Apps to close, then I click the End task button.
How to close all background programs in Windows?
How can I gracefully close all open apps except Explorer with one click or keystroke?
How to close all active windows/applications using a batch file - Stack Overflow
Quickly close all windows at once
Videos
We've all seen this happen. When you first buy a Windows PC, it seems to operate like a breeze. Programs open up and run with no difficulty.
Then after several months everything slows up. It becomes so bad that you have to buy a whole new computer. The assumption is there are some background processes that continue to run that prevent the computer from running more quickly. So how can you close all those background processes?
I know about opening the Task Manager. But there are usually so many processes running you can't tell which ones are essential for Windows to operate. I have tried shutting down some processes at random but I almost always get the warning "this is a system process and can't be shut down."
So can we shut down all those background processes so the computer is back to original pristine state and only the processes for the one program you want to run are operating?
All answers I could quickly find on this topic involve either the tip Molly gave or using an application (or coding it yourself). For example (I haven't tried this), Close All Windows.
Also, by pressing Ctrl + Shift + Esc you get the Windows Task Manager, where you can see all running applications at once (among other things), select them, and End Task them.
I like to see my open windows ungrouped, but realized that this i.e. closing multiple windows at once was a problem with such a setting. A less time-taking method would be to use the command line like this :
taskkill /im explorer.exe -f
And then restart explorer using :
explorer
Caution : This will cause processes like file copying on the default Windows interface to abort.
I'm doing some testing and frequently need to gracefully close all open apps either before running a program or rebooting. The batch file and PowerShell methods I've tried shut down chrome improperly, so I need to restore all open tabs. I want to simulate closing the app manually.
The main apps I typically have open are Chrome, Word, Titan Mail, Thunderbird, an image management program, Photoshop, possibly other Office or Adobe programs, and Notepad.
If you perform a treekill on explorer.exe, it will close all other programs except background processes. Those batch scripts will only work if they are called in an exceptional manner that makes them background processes, system processes or if they are not a child process of explorer.exe.
Here's the fastest reference implementation of my treekill explorer method
@echo off
echo closing all programs...
taskkill /f /t /im explorer.exe
explorer.exe
Here's an example implementation of my treekill explorer method combined with hibernate to make a fast shutdown and startup script.
@echo off
echo shutting down...
echo closing all programs...
taskkill /f /t /im explorer.exe
echo hibernating...
shutdown /f /h
echo restoring...
explorer.exe
echo thanks you for using JessieTessie's fast shutdown and startup.
You can do
@echo off
@powershell Get-Process | Where-Object {$_.MainWindowTitle -ne ""} | stop-process
taskkill /f /im explorer.exe
It will execute powershell command that will find and close all running programs that isn't hidden or evelated using windowtitle.
But it will close all apps including yours.
To prevent that you need to recode it from c++ (you can use system("somecommand") from windows.h) and before executing closeAll commands put freeconsole() in code. But you will need to find how to get console back.