Replace explorer.exe

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
boromyr
Posts: 3
Joined: 20 Jan 2021 19:08

Replace explorer.exe

Post by boromyr »

Hi, I'm trying to replace explorer.exe with XYplorer in the registry, as notepad++ replaces the classic notepad in Windows 10:

Code: Select all

reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "\"%ProgramFiles(x86)%\Notepad++\notepad++.exe\" -notepadStyleCmdline -z" /f
changed into:

Code: Select all

reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\explorer.exe" /v "Debugger" /t REG_SZ /d "\"C:\Program Files (x86)\XYplorer\XYplorer.exe\"" /f
And the call redirection works as expected even in apps that open explorer.exe even when "XYplorer is the default file manager", but the output I get is

Code: Select all

C:\Program Files (x86)\XYplorer\select,C:\Program Files (x86)\Microsoft\Edge Dev\Application\msedge.exe
Where Edge is an example of a wanted path, whereas it should be:

Code: Select all

C:\Program Files (x86)\Microsoft\Edge Dev\Application\
Could you tell me what I should add to correct this problem?
Thank you.

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Replace explorer.exe

Post by highend »

And the call redirection works as expected even in apps that open explorer.exe even when "XYplorer is the default file manager", but the output I get is
With which app exactly?

Apart from that you need a wrapper in "Image File Execution Options\explorer.exe" that starts XY with the correct argument, because the debugger entry will always call it with all arguments from which the first is the call to explorer.exe itself (and ofc, XY doesn't know what to do with that one)...
One of my scripts helped you out? Please donate via Paypal

boromyr
Posts: 3
Joined: 20 Jan 2021 19:08

Re: Replace explorer.exe

Post by boromyr »

For example Internet Download Manager, with which it is very common to open the download path, but the programs that call explorer are thousands.
Would you have any ideas on what to add?
I was thinking of a cmd script, to start XYplorer with /path, after a "regexreplace".

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Replace explorer.exe

Post by highend »

This AHK code should do the trick (you need to compile it...)

Code: Select all

#NoEnv
#NoTrayIcon
#SingleInstance, Force
SetBatchLines, -1

xyplorer := "C:\Program Files (x86)\XYplorer\XYplorer.exe"

; Trim double quotes otherwise e.g. from a dosbox:
; explorer.exe "D:\" would return as: D:\" (only with a trailing double quote)
arg2 := Trim(A_Args[2], Chr(34))

; Try to get only a real path (with or without file)
; Should work for local and network drives
; Finally it's double quoted again
arg2 := Chr(34) . RegExReplace(arg2, "m)^(.*?)(([A-Z]:|\\\\).*$)", "$2") . Chr(34)

; Run it...
Run, %xyplorer% %arg2%
Works fine with Internet Download Manager...
One of my scripts helped you out? Please donate via Paypal

boromyr
Posts: 3
Joined: 20 Jan 2021 19:08

Re: Replace explorer.exe

Post by boromyr »

Thank you very much!😁

remo0033
Posts: 10
Joined: 03 Jan 2021 00:17

Re: Replace explorer.exe

Post by remo0033 »

Closely related to this... I was considering replacing explorer.exe with xyplorer under ...
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell

Thereby replacing the shell of windows.

I plan to give it a try, but wanted to check with others first for any "gotchas".

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Replace explorer.exe

Post by highend »

If you can live with no direct access to any other desktop elements (tray icons, start menu, ...)?

That's more or less a "kiosk" mode with XY...
One of my scripts helped you out? Please donate via Paypal

Post Reply