Page 1 of 1

close all open folders in file explorer

Posted: 16 Mar 2020 17:05
by user124
Hi all,

I want to create a bat file that can close all open folders in the file explorer. However, it should not close any programs that are open (for example: excel, outlook, web browsers etc). Any help would be appreciated!

Thanks!

Re: close all open folders in file explorer

Posted: 17 Mar 2020 08:01
by Eureka!
What have you tried yourself? And where did that go wrong?

If you have Launch folder windows in a separate process enabled:

Code: Select all

taskkill.exe /im explorer.exe

If you have that setting disbaled:

Code: Select all

taskkill.exe /im explorer.exe /F & explorer.exe
The second command could also be used in the first case, but then does a lot of unneeded work.

(both commands are untested)