9

Is there a way to set another program as the default program that opens when opening a folder or "My Computer"? I would like to replace Windows explorer with another program e.g. FreeCommander. I tried looking through the control panel options for program associations but couldn't find an option for opening folders.

I assume there is some regex somewhere that could do it but I'm not going to go searching by hand.

Mokubai
  • 89,133
  • 25
  • 207
  • 233
KroniK907
  • 193
  • 1
  • 1
  • 4
  • You can do it through registry, but it would act as the default shell, replacing desktop and taskbar as well. –  Oct 10 '16 at 15:12
  • @ErelSegal-Halevi: What is that you want: (1) Total replacement which will replace the desktop, or (2) Replacing WIN+E invoked software, (3) Something else. – harrymc Dec 30 '20 at 15:23
  • @harrymc I want to replace only the file manager (specifically, I want to have a file-manager with tabs). – Erel Segal-Halevi Dec 31 '20 at 16:20
  • @ErelSegal-Halevi: Take your pick : [Best Free File Manager](https://www.techsupportalert.com/best-free-file-manager.htm). Search for "tabs" and you will see two recommended, but there may be more such from the list. – harrymc Dec 31 '20 at 21:29
  • @ErelSegal-Halevi: Or get [TidyTabs](https://www.nurgo-software.com/products/tidytabs) and add tabs to any program you like. See also [6 Free Tools to Enable Tabs in Windows Explorer](https://www.raymond.cc/blog/how-to-have-tabs-in-your-windows-explorer/). – harrymc Dec 31 '20 at 21:41
  • @harrymc OK, but how do I make one of these programs the default file manager? – Erel Segal-Halevi Jan 01 '21 at 08:03
  • 1
    Default in what sense? Intercepting Win+E is trivial, if that's what you want. With TidyTabs, for example, you can have Explorer in tabs. Another similar to TidyTabs is [TaskSpace](http://www.systemgoods.com/). – harrymc Jan 01 '21 at 09:15
  • @harrymc Thanks! I installed the free / donationware softward QTTabBar and it indeed puts tabs in the default Windows Explorer, which is what I needed. I did not know it was so simple. – Erel Segal-Halevi Jan 04 '21 at 08:25
  • @ErelSegal-Halevi: Good - I added an answer about that. – harrymc Jan 04 '21 at 08:35

5 Answers5

3

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.

rlaphoenix
  • 31
  • 4
3

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.

1

Not sure about FreeCommander, but Q-Dir has an option to set that file manager as the default:

enter image description here

That setting has some limitations, though, if run as a portable application. For example, Win E starts Windows Explorer, though there is a context menu entry to open a folder with Q-Dir.

DrMoishe Pippik
  • 25,661
  • 4
  • 36
  • 54
1

You can change any association via regedit, however, backup the existing configuration (and if you don't know what you're doing then your PC too) first though.

Look under HKEY_CLASSES_ROOT\Folder\shell\open\command.

Danny
  • 120
  • 4
1

In his bounty, Erel Segal-Halevi asked for a file-manager with tabs.

There are many alternate file-managers, mostly free ones, and some of them support tabs. A list of such products with reviews is found in the article Best Free File Manager. From this list, Erel chose QTTabBar, which extends Windows Explorer by tabs and extra folder views.

There exist even products that can add tabs to any product on Windows, including Windows Explorer: TidyTabs and TaskSpace.

harrymc
  • 455,459
  • 31
  • 526
  • 924