When browsing files and folders, you might open multiple Windows Explorer windows. For a shortcut to close all those Windows Explorer windows, you can set up a hotkey that will close them. Although Windows doesn’t include options to set up custom keyboard shortcuts, the NirCmd command-line utility software does the trick.
The NirCmd software is available for most versions of Windows. To add it to your software library, click on the Download NirCmd option at the bottom of this page. As it saves as a Zip file, you should extract it by right-clicking the file and selecting Extract All. Then select a destination for the extracted folder and click Extract.
Now right-click on the Windows desktop, and select New > Shortcut from the context menu. That opens the window below where you should enter the following: C:\Enter\Folder\Location\nircmd.exe win close class “CabinetWClass.” Of course, you must delete enter, folder and location from that and replace it with the actual location of the extracted NirCmd folder location.
Click Next, give the shortcut a suitable title and then select Finish. Now there will be a shortcut on the desktop as below. Open multiple Windows Explorer windows, and then click on that desktop shortcut to close them.
Now assign a hotkey to that desktop shortcut. Right-click on the desktop shortcut and select Properties to open the window below. Enter a hotkey in the Shortcut key text box, and click Apply and OK to close the window.
Open multiple Windows Explorer windows and press the hotkey you added to the Shortcut key text box. That will then close all the open Windows Explorer windows. This is a handy hotkey when there are dozens of Explorer windows open.