File Managers Redirection: Redirect Explorer to Your Preferred File Manager

Discuss and share scripts and script files...
Post Reply
Norn
Posts: 491
Joined: 24 Oct 2021 16:10

File Managers Redirection: Redirect Explorer to Your Preferred File Manager

Post by Norn »

This script requires AutoHotkey v2
Redirect Explorer to Your Preferred File Manager — and Switch Between File Managers Dynamically (XYplorer, DOpus, File Pilot).
Your chosen manager works like a "default" file manager.
The redirection process hides the Explorer window and is normally invisible.
The INI file is a configuration file and can be modified as needed.

:arrow: File Managers Redirection: Redirect Explorer to Your Preferred File Manager (XYplorer, DOpus, File Pilot)

v1.0.11: XY<->DOpus
v1.0.10: Adjust the code to hide Explorer window.
v1.0.9: Supports desktop. Redirect to Explorer supports multiple selections and reuse of windows. redirects Opus to Explorer. hotkey switching adds tooltips.
v1.0.8: Fixed flickering when redirecting control panel.
v1.0.7: Adding EVENT_OBJECT_SHOW event, seems to make the window almost invisible.
v1.0.6: Redirect Recycle Bin, correct regular expression.
v1.0.5: Added wildcard support to excluded list. CLSID list
v1.0.4: Added excluded list, one per line.
v1.0.3: Fixed redirection Control Panel.
Last edited by Norn on 29 Dec 2025 22:21, edited 24 times in total.
Windows 11 24H2 @100% 2560x1440

xy123
Posts: 214
Joined: 17 Sep 2017 11:46
Location: Win10 64-bit, @100%

Re: [AutoHotkey v2] Redirect Explorer Windows

Post by xy123 »

This is perfect, thank you for sharing. :appl:


Texano88
Posts: 49
Joined: 08 Oct 2021 23:22
Location: Windows 11 23H2 125% XY 27.90+ beta

Re: [AutoHotkey v2] Redirect Explorer Windows

Post by Texano88 »

How to add a list of custom window names to exclude from re-addressing? For example, This PC||myPath?

Norn
Posts: 491
Joined: 24 Oct 2021 16:10

Re: [AutoHotkey v2] Redirect Explorer Windows

Post by Norn »

Try v1.0.4.

Code: Select all

[excludeList_OnePerLine]
::{26EE0668-A00A-44D7-9371-BEB064C98683}
E:\Test
Windows 11 24H2 @100% 2560x1440

Texano88
Posts: 49
Joined: 08 Oct 2021 23:22
Location: Windows 11 23H2 125% XY 27.90+ beta

Re: [AutoHotkey v2] Redirect Explorer Windows

Post by Texano88 »

It doesn't seem to work, even the control panel doesn't work anymore:

Code: Select all

[RedirectToggle_1=SecondComandLine]
key=0
[TrayMenu_DarkMode]
key=1
[excludeList_OnePerLine]
::{26EE0668-A00A-44D7-9371-BEB064C98683}
*.pbd
Questo PC
This PC
C:

Norn
Posts: 491
Joined: 24 Oct 2021 16:10

Re: [AutoHotkey v2] Redirect Explorer Windows

Post by Norn »

I added wildcard support in v1.0.5. This PC, Home, etc. need to use CLSID, such as::{20D04FE0-3AEA-1069-A2D8-08002B30309D}, or use a script to get it:

Code: Select all

#Requires AutoHotkey v2.0
f3::                         ; Press F3 to get the Explorer Selection
{
    explorerItems := explorerGetSelection()
	msgbox("Path Copied!`n" . explorerItems)
	A_Clipboard := explorerItems
}

explorerGetSelection(hwnd := WinExist("A")) {   ; by ntepa -- https://www.autohotkey.com/boards/viewtopic.php?p=529074#p529074
    if !RegExMatch(WinGetClass(hwnd), "^((?<Desktop>Progman|WorkerW)|CabinetWClass)$", &Match)
        return
    shellWindows := ComObject("Shell.Application").Windows
    ; get desktop or explorer window.
    if Match.Desktop ; 0x13 = VT_UI4, 0x8 = SWC_DESKTOP
        window := shellWindows.Item(ComValue(0x13, 0x8)).Document
    else {
        try activeTab := ControlGetHwnd("ShellTabWindowClass1", hwnd)
        for w in shellWindows {
		    try {
                if w.hwnd != hwnd
                    continue
                if IsSet(activeTab) {
                    IID_IShellBrowser := "{000214E2-0000-0000-C000-000000000046}"
                    shellBrowser := ComObjQuery(w, IID_IShellBrowser, IID_IShellBrowser)
                    ComCall(3, shellBrowser, "uint*", &thisTab:=0)
                    if thisTab != activeTab
                        continue
                }
                window := w.Document
                break
			}
        }
    }

    Items := ""
    try for i, in window.SelectedItems {
        Items .= (A_Index > 1 ? "`n" : "") i.Path ; append each selected item and add a new line.
    }
	else
        return window.Folder.Self.Path
	catch
	    for window in shellWindows
		    try if (window.hwnd==hwnd)
				for i, in window.SelectedItems
                    Items .= (A_Index > 1 ? "`n" : "") i.Path ; append each selected item and add a new line.

    return Items
}
Windows 11 24H2 @100% 2560x1440

Texano88
Posts: 49
Joined: 08 Oct 2021 23:22
Location: Windows 11 23H2 125% XY 27.90+ beta

Re: [AutoHotkey v2] Redirect Explorer Windows

Post by Texano88 »

It works, thank you very much. If there are new versions, I will download them immediately ;)

autocart
Posts: 1359
Joined: 26 Sep 2013 15:22

Re: [AutoHotkey v2] Redirect Explorer Windows

Post by autocart »

Norn wrote: 26 Nov 2023 16:38This PC, Home, etc. need to use CLSID, such as::{20D04FE0-3AEA-1069-A2D8-08002B30309D}, ....
Norn wrote: 23 Sep 2023 23:45 CLSID list
Ah, neat! :)

Post Reply