Page 1 of 1

File Managers Redirection: Redirect Explorer to Your Preferred File Manager

Posted: 23 Sep 2023 23:45
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.

Re: [AutoHotkey v2] Redirect Explorer Windows

Posted: 24 Sep 2023 16:12
by xy123
This is perfect, thank you for sharing. :appl:

Re: [AutoHotkey v2] Redirect Explorer Windows

Posted: 23 Nov 2023 19:19
by autocart
:tup:

Re: [AutoHotkey v2] Redirect Explorer Windows

Posted: 25 Nov 2023 20:35
by Texano88
How to add a list of custom window names to exclude from re-addressing? For example, This PC||myPath?

Re: [AutoHotkey v2] Redirect Explorer Windows

Posted: 26 Nov 2023 12:22
by Norn
Try v1.0.4.

Code: Select all

[excludeList_OnePerLine]
::{26EE0668-A00A-44D7-9371-BEB064C98683}
E:\Test

Re: [AutoHotkey v2] Redirect Explorer Windows

Posted: 26 Nov 2023 14:16
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:

Re: [AutoHotkey v2] Redirect Explorer Windows

Posted: 26 Nov 2023 16:38
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
}

Re: [AutoHotkey v2] Redirect Explorer Windows

Posted: 26 Nov 2023 16:53
by Texano88
It works, thank you very much. If there are new versions, I will download them immediately ;)

Re: [AutoHotkey v2] Redirect Explorer Windows

Posted: 26 Nov 2023 17:33
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! :)