Force new File Explorer's
windows to Tabs:
Intercept Win+E
keys and File Explorer's
directory opening to open a new tab instead.
Note: The File Explorer's Tabs feature is only available in Windows 11 22H2 Build (22621) or later.
To prevent having multiple Explorer windows opened like this:
-
Download
ExplorerTabUtility
from the Releases page. -
Run the application:
A tray icon will be visible with the following options:
✅
Keyboard (Win + E):
If you want to open new tab when Win+E are pressed.✅
All Windows:
If you want to force all new windows to open a new tab instead.-
UI (Recommended):
To open and navigate using (UI Automation), which is the recommended way. -
Keys:
To Open and navigate using the keyboard (CTRL + T, CTRL + L, typing the location, etc...).Don't use
Keys
unlessUI
is not working.Or if
Keys
is simply faster for you.Maybe that's because you tweaked your Windows UI look,
✅
Add to startup:
If you want the application to start on system startup. -
-
(
Win+E hook
) By setting a global keyboard hook to listen for Win+EThis way we can catch the keys before a new window is created to prevent it, and then we open a new tab instead (it is much faster than the
All Windows hook
). -
(
All Windows hook
) By using the FlaUI library that wraps the native UI Automation, We use it to hook theWindowOpenedEvent
event (which is triggered for any new window not just File Explorer).We filter that window by it's class name to check if it's a File Explorer window or not.
If it has the class
CabinetWClass
that means it's a File Explorer window, we then hide the window right away to extract the location and the selected files (if any).Then we close the window and pass the location and selected files to the next step.
-
We use the FlaUI library to click the
Add new Tab
button in the explorer window, and set the location & select the files (if any),Or if you choose
Keys
underAll Windows
: We use H.InputSimulator to Open and navigate using the keyboard (CTRL + T, CTRL + L, typing the location, etc...).
-
There is a slight delay when a new File Explorer window is opened before we can hide it and extract the location and the selected files.
-
When a File Explorer is already opened in the given directory, Windows just focuses the existing window instead of creating a new one and thus our approach doesn't work.
Technically, there is a Window Focused/Activated Event that can detect that, but the user selecting the window could also fire it, which won't be great for normal usage of the File Explorer when needed.
-
When multiple windows are opened at the same time it takes some time to handle all of them.
-
For multiple virtual desktops it switches back to the one that has an opened File Explorer.
-
We've to click on the window's address bar and sometimes it shows the suggest box and it stays visible.
I've tried using Shell.Application
(Shell32
) instead of FlaUI
(UI Automation) to open and navigate the tabs which could be much faster and cleaner, But sadly Windows Shell only works for the first tab of a window and we can't control it.
This project is licensed under the terms of the MIT license.