On the command line on Windows 8.1, how can I kill/close all Windows file explorer windows... but without killing and restarting the shell?
It's crazy that they're the same process.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityOn the command line on Windows 8.1, how can I kill/close all Windows file explorer windows... but without killing and restarting the shell?
It's crazy that they're the same process.
You can use the command line utility NirCmd (freeware) (archive.org's mirror for the webpage; archive.org's mirror for the binary) and execute:
nircmd.exe win close class "CabinetWClass"
I use it on Windows 7 SP1 x64 Ultimate and it works as intended: it will close all Windows Explorer windows, but won't kill the explorer.exe
process.
The program is supposed to work on Windows 9x/ME, Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7, Windows 8, and Windows 10.
Complementing Franck's brilliant response:
You can automate a shortcut to this command by following the steps:
nircmd.exe win close class "CabinetWClass"
now whenever you type the steps below, windows explorer windows will be closed WITHOUT terminating the explorer.exe process
Don't know how to access the user's folder?
Follow the instructions: