Page 1 of 1

Replace explorer.exe

Posted: 26 Jun 2021 15:04
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.

Re: Replace explorer.exe

Posted: 26 Jun 2021 17:07
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)...

Re: Replace explorer.exe

Posted: 26 Jun 2021 21:45
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".

Re: Replace explorer.exe

Posted: 26 Jun 2021 22:11
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...

Re: Replace explorer.exe

Posted: 02 Jul 2021 18:54
by boromyr
Thank you very much!😁

Re: Replace explorer.exe

Posted: 04 Jul 2021 13:40
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".

Re: Replace explorer.exe

Posted: 05 Jul 2021 16:45
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...