How can I quickly close many Windows/Programs?

20

3

My workflow includes many open windows. Sometimes I want to clean up and close around 10 of them (but not all). How can I achieve this fast and simple on Windows?

Edit: "but not all" to me means "selectively", not grouped by program or name, and not always the same. During research phase, I usually have opened some diff tools, some console windows, some svn logs, some explorer windows and some plain text editors. I permanently have and keep opened a mail program, an IDE, the spreadsheet where I record my time spent and a browser. Opening huge projects in the IDE takes time, so I don't want to a killall or log-off-log-on procedure.

Sascha

Posted 2017-04-25T12:49:02.407

Reputation: 854

1I was going to say "Use a virtual desktop manager", but realized none of them that are able to close several windows at once are supported on windows 10. – Dmitry Grigoryev – 2017-04-25T15:34:49.730

1If you always maximize your windows instead of having hundreds of windowed windows, then the close button is always in the same location. Alt+F4 is the old standby for closing a window on Windows. If you don't care about saving anything and always close the same set of windows, the absolute fastest way is to use OpenProcess()/KillProcess() in a command-line program/script. If you are closing windows to access the desktop, there are two faster ways: The little-known Desktop Toolbar you can enable from the taskbar (should be enabled by default, IMO) and Win+M / Win+Shift+M. – CubicleSoft – 2017-04-26T03:35:05.673

I prefer the Ctrl + W. It closes like the ALT + F4 – Roy Bogado – 2017-04-26T08:37:37.140

2^w very much depends on the applications. Many act in that fashion, especially software using MDI, but I would say caveat emptor – Alt+F4 is the platfrom standard "close program" shortcut and in my experience more reliable. (Although ^w is much more comfortable to type on QWERTlike keyboards.) – Cornelius – 2017-04-26T09:43:30.653

1@Roy Ctrl-W sometimes works as Alt-F4, sometimes as Ctrl-F4 depending on the software (mind you, so does Alt-F4) – Chris H – 2017-04-26T13:33:01.057

Is there any kind of pattern to the ones you want to kill? You might be able to build a batch script around TASKKILL with all its myriad options to kill the ones you want (and you can create a shortcut to the .bat and give it a hotkey). If some of the windows are command-prompts, judicial use of the "title" option of START can help (as TASKKILL can select by title). In my case, I have three command-line servers and two GUI clients that I can kill in one go with a small script. – TripeHound – 2017-04-26T16:52:59.757

Agreeing with @TripeHound. Or in PowerShell, Stop-Process. – xdhmoore – 2017-04-26T17:53:08.237

This very much depends on how you specify "but not all" ... – Hagen von Eitzen – 2017-04-26T18:45:43.830

1Step 1: Be fast. Step 2: Click on the red X for the apps you want to close? – airstrike – 2017-04-27T12:57:00.077

1and remember as well as Andre Terras advice, move the mouse fast and hit the button hard: makes it more effective :P – GMasucci – 2017-04-27T15:03:18.433

Answers

43

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.

Sascha

Posted 2017-04-25T12:49:02.407

Reputation: 854

2Interesting. I always use Alt+Tab and the X. Win+Tab is a bit quicker since you do not have to hit exactly the small spot. Thanks for this. – Michael S. – 2017-04-25T14:43:34.787

7You can also middle-click the app in the Alt+Tab view (though I'm not sure if it closes all windows of a given app). – Cornelius – 2017-04-25T16:59:06.120

27+ Taskbar Tweaker is great. And I've just realised why it's called that lol – Lightness Races with Monica – 2017-04-25T20:32:12.793

2Middle click on the taskbar is by default a command to open a new window of the target app, even if it's already running coz some apps have an ability to show multiple windows. – user1306322 – 2017-04-25T22:41:57.447

2If you hover over the Taskbar icons and show the thumbnails of the windows, you can middle click on the thumbnails to close that instance. – Chloe – 2017-04-27T00:24:08.403

9

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.

Yacine

Posted 2017-04-25T12:49:02.407

Reputation: 268

3this is more drastic than closing and you may miss a chance to save your work or settings. – Kate Gregory – 2017-04-26T01:20:43.537

7OP was asking for fast and simple, and this is it – Denny – 2017-04-26T07:43:28.540

2@KateGregory I've just tested, and notepad gives a "save/don't save" prompt. On top of that Is "[End Program - Untitled- Notepad] The system cannot end this program because it is waiting for a reponse from you...[End Now][Cancel]". So it's not too much of a worry. (win7 btw) – Chris H – 2017-04-26T13:36:31.073

2@ChrisH some apps will do that, and some won't. – Kate Gregory – 2017-04-26T14:03:46.153

@KateGregory most do but I'm wary enough to hit save then close in most things. Task manager appears to try to close gently at first so very similar to the application's own close function. This would be good for me having lots of calculator /picture viewer/Firefox/pdf viewer Windows open – Chris H – 2017-04-26T14:11:00.777

On all the W10 computers I have, the Task Manager has no "Application" tab. It has the "Processes" and "Details" tabs, but none allows for multiple selection. – Martin Argerami – 2017-04-26T18:10:26.290

8

If they are windows of the same app, you can also right-click the entry in the task bar and select "close all windows".

Cornelius

Posted 2017-04-25T12:49:02.407

Reputation: 661

4

If it is a known group of applications that you want to close each time you could use something like AutoHotKey to create a shortcut that closes just those windows.

Use the Window Spy (included with AHK) to most easily get the details you'd need about the windows and then use IfWinExist and WinClose commands.

Joshua Hunter

Posted 2017-04-25T12:49:02.407

Reputation: 361

3

Alt + F4 will close whatever window is in focus (and shut down windows if nothing is selected). You could combine this with Alt + Tab or Win + Tab to try to get to the desired windows quickly.

Zaren

Posted 2017-04-25T12:49:02.407

Reputation: 31

You are some how repeating another answer – yass – 2017-04-25T18:45:48.553

3

Simplest, all keyboard-bound: Alt+Tab , hit Del to close highlighted window.

Tested on Win 10. Played around and found this solution.

Rasmus Gustafsson

Posted 2017-04-25T12:49:02.407

Reputation: 31

2

If they're the same processes each time (E.G. Notepad, Photoshop, and Chrome), you could write a simple batch script to close all of them at once. Then you would just need to run the script whenever you want to close them.

For example:

killmystuff.bat

taskkill /IM notepad.exe
taskkill /IM photoshop.exe
taskkill /IM chrome.exe

Note that this will not force close them - To do so, specify the /F flag. It will also kill all processes with that image name, so can't be used to close a specific group of Chrome tabs or similar.

You can also use filters to select groups of programs by username, window title, memory usage, etc - See taskkill /? for more details.

Larkeith

Posted 2017-04-25T12:49:02.407

Reputation: 266

1

I find that the fastest way to natively achieve this is like this:

  1. Click on the desired program in your task bar
  2. alt + F4

This is quicker because you close precisely the programs you wish to close where as alt + tab-ing through your programs forces you to step over unwanted programs causing you to endure more time.

MonkeyZeus

Posted 2017-04-25T12:49:02.407

Reputation: 7 101

1

If you don't have a long login time (i.e. lots of startup-specific programs), then logging out is a reasonable way to do it. Assuming you don't have anything to save, that Chrome keeps your tabs, etc.

Christopher Hostage

Posted 2017-04-25T12:49:02.407

Reputation: 4 751

2I think the "(but not all") in the question means this doesn't help. – Chris H – 2017-04-26T13:37:47.493

1

If you hover over the app in the taskbar, a preview will appear just above it that includes an X. You can move your mouse a very small distance to that X, and click it. You don't have to switch back and forth between mouse and keyboard.

Kate Gregory

Posted 2017-04-25T12:49:02.407

Reputation: 966

1

The problem with just holding Alt + F4 is that it it sometimes will bring up the log off / shutdown / sleep menu.

I like to hold Alt + Esc to get all my windows in focus (by cycling through them) and then holding Alt+F4

philn

Posted 2017-04-25T12:49:02.407

Reputation: 111

0

In case the windows you mention are part of the same application (like a lot of separate files, opened by one single text editor), you might use Ctrl + F4

Dominique

Posted 2017-04-25T12:49:02.407

Reputation: 1 013

0

you can use:

1.Taskmanager to close windows.(The taskbar shows the currently running tasks)

i.Rightclick on taskbar

ii.click on start task manager

iii.In windowsTaskbar window,in applications tab you can see the applications which are all opened.select the necessary applications to be closed using ctrl key

iv.click on endtask button.

2.You can also "alt+f4"..Actually it closes the current running window

user722384

Posted 2017-04-25T12:49:02.407

Reputation: 1

0

Because I have a multiple monitor setup at work, I found it sad that the Windows task-bar (by default) was* limited to one screen. I didn't like the various options to change this situation, so I made a tool of my own: SideSwitch. Warning: it's very tuned to my own way of working and may behave intrusive to your way of working if you're not used to it! When the mouse-cursor is at the edge of a screen - the center two quarters, not the corners - a list of windows is shown that are on that screen. Also "x" and "_" is shown to respectively close or minimize that window. (The main reason for the application was also to have the "Switch" button to painlessly move maximized windows between monitors, but since Windows 7 that's possible by dragging the maximised window's caption bar.)

*: recent Windows versions have more options

Stijn Sanders

Posted 2017-04-25T12:49:02.407

Reputation: 2 226

1FYI On Windows 10 the task bar displays on whatever monitor the mouse pointer is on. – chue x – 2017-04-26T15:48:58.913

@chuex depends on the settings. You can make it visible on all monitors at any time(and stay visible) ! – Felix D. – 2017-04-26T21:02:30.043

0

I've done something similar with auto-hotkey. Off the top of my head, I can't remember exactly what it was, but it was something with an F9 toggle like:

F9::Toggle
Loop, 100
{
    IfWinNotActive [, MadeUpWindowThatDoesn'tExist/Can'tBeFound]
    Gosub, sub1

    sub1:
    IfWinActive [, WindowYouWouldWantToKeepOpen]
    Gosub, sub2
    Else
    Gosub, sub3

    sub2:
    SendInput !{Tab}

    sub3:
    SendInput ^w
}
return

Now again, off the top of my head, it's likely a little different than this. If you copy and paste this bit of AHK, it likely won't work and you'll have to tweak it, but this is the core idea of what could work.

Shankensteinium

Posted 2017-04-25T12:49:02.407

Reputation: 111