This script forces Windows 11 to open file explorer in a new tab instead of a new window:
#Requires AutoHotkey v2.0
Persistent
ForceOneExplorerWindow()
class ForceOneExplorerWindow {
static __New() {
this.FirstWindow := 0
this.hHook := 0
this.pWinEventHook := CallbackCreate(ObjBindMethod(this, 'WinEventProc'),, 7)
this.IgnoreWindows := Map()
}
static Call() {
this.MergeWindows()
if !this.hHook {
this.hHook := DllCall('SetWinEventHook', 'uint', 0x8000, 'uint', 0x8002, 'ptr', 0, 'ptr', this.pWinEventHook
, 'uint', 0, 'uint', 0