Replace windows explorer as default file viewer in windows 10?

Solution 1:

In general, PHOENiX's question is right, but there's one issue with it. The registry key HKEY_CLASSES_ROOT\Folder covers not just directories, but also various special folders, like for example items in the Control Panel, etc. They're those GUID strings, PHOENiX is writing about. If you try to open such a special folder in a 3rd-party file manager, it will most likely fail, so you won't be able to use those folders anymore.

What you actually want is to configure just directories and drives to be opened in your file manager. There are two registry keys for that:

  • HKEY_CLASSES_ROOT\Directory
  • HKEY_CLASSES_ROOT\Drive

Here are two examples of how to set Total Commander as a default file manager. Both cause any directory or drive to be opened in a new tab in Total Commander when clicked (e.g. in the Start menu), double-clicked (e.g. on the Desktop, Windows File Explorer, etc.), opened from another application, etc. The only difference is that the first one is using the Open item in the directory/drive context menu and the second one is adding a new item Open in Total Commander with the Total Commander's icon to the context menu.

Just copy & paste the content below into a new file, give it the .reg extension and execute it. Of course, you need to make sure you have the correct path to the Total Commander's executable.

Check the documentation for more details.

1. Use the default Open item

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Drive\shell]
@="open"

[HKEY_CLASSES_ROOT\Drive\shell\open\command]
@="\"C:\\Program Files\\totalcmd\\TOTALCMD64.EXE\" \"%1\" /T /O /S"

[HKEY_CLASSES_ROOT\Directory\shell]
@="open"

[HKEY_CLASSES_ROOT\Directory\shell\open\command]
@="C:\\Program Files\\totalcmd\\TOTALCMD64.EXE \"%1\" /T /O /S"

2. Add a new context menu item Open in Total Commander

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Drive\shell]
@="TotalCommander"

[HKEY_CLASSES_ROOT\Drive\shell\TotalCommander]
@="Open in Total Commander"

[HKEY_CLASSES_ROOT\Drive\shell\TotalCommander\command]
@="\"C:\\Program Files\\totalcmd\\TOTALCMD64.EXE\" \"%1\" /T /O /S"
"Icon"="C:\\Program Files\\totalcmd\\TOTALCMD64.EXE,0"

[HKEY_CLASSES_ROOT\Directory\shell]
@="TotalCommander"

[HKEY_CLASSES_ROOT\Directory\shell\TotalCommander]
@="Open in Total Commander"
"Icon"="C:\\Program Files\\totalcmd\\TOTALCMD64.EXE,0"

[HKEY_CLASSES_ROOT\Directory\shell\TotalCommander\command]
@="C:\\Program Files\\totalcmd\\TOTALCMD64.EXE \"%1\" /T /O /S"

Total Commander's command-line parameters

There're 4 command-line parameters used in the above examples:

  • "%1": a path of the opened directory/drive, should be in quotes to correctly handle paths with whitespace characters
  • /O: use the existing instance of Total Commander instead of executing a new one
  • /T: open a new tab instead of reusing the currently active one
  • /S: the opened directory/drive will be treated as a source, so it will be opened in the panel where's the currently active tab

Check the documentation for more parameters.

Solution 2:

By comparing the Registry before and after setting Q-Dir as a file explorer with it's option in "Extras" menu, here is what it actually does (since the software doesn't seem to be open source):

Key: HKEY_LOCAL_MACHINE\Software\Classes\Folder\shell
Change: Added Value
Value: *Q-Dir
Type: REG_SZ

Key: HKEY_LOCAL_MACHINE\Software\Classes\Folder\shell\*Q-Dir
Change: Added Key

Key: HKEY_LOCAL_MACHINE\Software\Classes\Folder\shell\*Q-Dir
Change: Added Value (Icon)
Value: C:\Program Files\Q-Dir\Q-Dir.exe
Type: REG_SZ

Key: HKEY_LOCAL_MACHINE\Software\Classes\Folder\shell\*Q-Dir\command
Change: Added Key

Key: HKEY_LOCAL_MACHINE\Software\Classes\Folder\shell\*Q-Dir\command
Change: Added Value
Value: "C:\Program Files\Q-Dir\Q-Dir.exe" /e>%L>%D>%1>%S>
Type: REG_SZ

It's creating a shell command that would also be in the context menu, however, this one will be the "default" action, so if you open something in Windows File Explorer, it will open in Q-Dir instead.

The first registry change sets the default shell to be the newly created *Q-Dir shell command.

The last registry change's value has the following meaning:

"C:\Program Files\Q-Dir\Q-Dir.exe" -- Execute Q-Dir.exe
/e>%L>%D>%1>%S> -- with these arguments

>%L>%D>%1>%S> are command-line variables which are further explained here: Which special variables are available when writing a shell command for a context menu

However, the > between them and the /e is specific to Q-Dir. Q-Dir specifically implemented a /e switch that takes the values so it can split by > and use as needed in a priority chain.


The big question, Is this safe?

We don't know for sure but do this with caution. I already noticed that the shell replacement program may get provided an argument that one might expect to be a file path when in reality it turns out to be a weird GUID string, e.g. in the format of ::{123E4567-E89B-12D3-A456-426614174000}\8\::{123E4567-E89B-12D3-A456-426614174000}. This for example occurs if you right-click -> uninstall on an app in the start menu, which would normally get passed to explorer (the default shell) and handled from there.

One way to handle this problem would be to make an intermediate program that takes the arguments, ensures it's a file path and if not, pass the arguments to explorer.exe instead of opening the real wanted shell. Programs like Q-Dir have either this or something similar programmed directly in it, hence why this isn't needed for Q-Dir.