Make Total Commander default file explorer

English support forum

Moderators: white, Hacker, petermad, Stefan2

PeterCullenBurbery
Junior Member
Junior Member
Posts: 7
Joined: 2023-02-17, 15:21 UTC

Make Total Commander default file explorer

Post by *PeterCullenBurbery »

I know there is a way to make Opus Directory the default file explorer. Is there a way to make Total Commander the default file explorer?
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Make Total Commander default file explorer

Post by *Stefan2 »

Hi and welcome PeterCullenBurbery, please search or google the forum for the answer (which is yes ;-) )









 
PeterCullenBurbery
Junior Member
Junior Member
Posts: 7
Joined: 2023-02-17, 15:21 UTC

Re: Make Total Commander default file explorer

Post by *PeterCullenBurbery »

I'm not sure how to do so with editing the registry keys with regedit and the Windows registry.
User avatar
HerbieH
Member
Member
Posts: 145
Joined: 2003-02-11, 10:04 UTC

Re: Make Total Commander default file explorer

Post by *HerbieH »

Hello PeterCullenBurbery.

You wrote:
I'm not sure how to do so with editing the registry keys with regedit and the Windows registry.

My answer is:
Whether you are a very young person or a somehow elderly one, it is never too late to start learning stuff about things, you want to master.

I have a degree in music science and have played piano and several other instruments from I was very young.
My interest for computer technology originated from the need of finding a program, that could write a music score, quickly, from a MIDI keyboard,
and, with a few corrections, print it out on paper. Next came my my urge for finding a useful but cheap 'sequencer' as a music recording program was called at that time.

That was in 1970 :D I managed finding an affordable, and good score printer in 2001 !
But during that time, I developed a 'geeky' computer knowledge, which came useful for many other purposes.


Do you see the light ?? (..as spoken by James Brown in the movie 'Blues Brothers')


You simply cannot start doing advanced stuff, like replacing the Windows User Interface with 'Total Commander', without having learned to use the regeditor. So good luck starting learning a new skill of doing advanced stuff with your computer.

Nothing beats getting thoroughly into things. And I promise you 100%, you will never regret having done that, BECAUSE, as John Kennedy said: 'We do this, not because it it easy, but because it is hard!'

Every time, you do so, you become more intelligent, and that becomes addictive :lol: !!!


And THAT concludes my 'OldGrumpySchoolTeacher' multi-verse ...for the time beeing :evil:.
HerbieH*
-Keep on makin' music!
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Make Total Commander default file explorer

Post by *Horst.Epp »

Store this file for example as tc.reg
Change the path to your TC installation path.
Note that all \ in the path to TC must be doubled !
Double click the file after modification and accept the message from Regedit.

Code: Select all

Windows Registry Editor Version 5.00
 
 [HKEY_CLASSES_ROOT\Drive\shell]
 @="open"
 
 [HKEY_CLASSES_ROOT\Drive\shell\open]
 
 [HKEY_CLASSES_ROOT\Drive\shell\open\command]
 @="c:\\tools\\wincmd\\TOTALCMD64.EXE /O \"%1\""
 
 [HKEY_CLASSES_ROOT\Directory\shell]
 @="open"
 
 [HKEY_CLASSES_ROOT\Directory\shell\open]
 
 [HKEY_CLASSES_ROOT\Directory\shell\open\command]
 @="c:\\tools\\wincmd\\TOTALCMD64.EXE /O \"%1\""
 
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
PeterCullenBurbery
Junior Member
Junior Member
Posts: 7
Joined: 2023-02-17, 15:21 UTC

Re: Make Total Commander default file explorer

Post by *PeterCullenBurbery »

What would be a way to do this manually with the Regedit GUI?
I had to reinstall Windows by deleting all programs and trying to change the default file explorer to Total Commander.
PeterCullenBurbery
Junior Member
Junior Member
Posts: 7
Joined: 2023-02-17, 15:21 UTC

Re: Make Total Commander default file explorer

Post by *PeterCullenBurbery »

How can I find the path of Total Commander?
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Make Total Commander default file explorer

Post by *Gral »

Last line of "Help" - "About" window
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Make Total Commander default file explorer

Post by *Horst.Epp »

PeterCullenBurbery wrote: 2023-02-18, 21:59 UTC What would be a way to do this manually with the Regedit GUI?
I had to reinstall Windows by deleting all programs and trying to change the default file explorer to Total Commander.
What would be the benefit to do that in the Regedit GUI ?
There is none !
No one does such jobs in the GUI.

Btw. there is also a .reg file to restore the default settings.

Code: Select all

Windows Registry Editor Version 5.00
 
 [HKEY_CLASSES_ROOT\Drive\shell]
 @="none"
 
 [HKEY_CLASSES_ROOT\Directory\shell]
 @="none"
 
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Re: Make Total Commander default file explorer

Post by *tuska »

Hi,

Out of interest, I successfully set this up in Total Commander x64.
(Description in English and below in German language).
  1. Copy the code linked here [or under point 3.] into an empty file from a text editor
  2. Save the file in a text editor as a .reg file - file name, e.g. WindowsExplorer_To_TotalCommander_ON.reg
    1. Windows-Editor 11.2210.5.0 - Filename: WindowsExplorer_To_TotalCommander_ON.reg
    2. Notepad3: File - Save as... - Filename: WindowsExplorer_To_TotalCommander_ON.reg
    3. EmEditor Pro: File - Save as... - File type: Ini (*.ini;*.inf;*.reg) - Filename: WindowsExplorer_To_TotalCommander_ON.reg
  3. Adapt the path given in the code in lines 9 and 17 to TOTALCMD64.exe to your own path [and CODE] - example:
    FROM: @="c:\\tools\\wincmd\\TOTALCMD64.EXE /O \"%1\"" ... this is the path in the forum post: c:\tools\wincmd\ ... opens folder in the left TC panel
    TO :    @="C:\\totalcmd\\TOTALCMD64.EXE /O /A /S \"%1\"" ........ this is my installation path .......: c:\totalcmd\ ... opens folder in the active TC panel
    WindowsExplorer_To_TotalCommander_ON.reg - Example for installation path: c:\totalcmd\

    Code: Select all

    Windows Registry Editor Version 5.00
     
     [HKEY_CLASSES_ROOT\Drive\shell]
     @="open"
     
     [HKEY_CLASSES_ROOT\Drive\shell\open]
     
     [HKEY_CLASSES_ROOT\Drive\shell\open\command]
     @="C:\\totalcmd\\TOTALCMD64.EXE /O /A /S \"%1\""
     
     [HKEY_CLASSES_ROOT\Directory\shell]
     @="open"
     
     [HKEY_CLASSES_ROOT\Directory\shell\open]
     
     [HKEY_CLASSES_ROOT\Directory\shell\open\command]
     @="C:\\totalcmd\\TOTALCMD64.EXE /O /A /S \"%1\""
    
  4. Start Total Commander as administrator(!) with the following button and confirm the User Account Control (UAC) query:
    TC as Admin -> copy and paste this code onto your Buttonbar...

    Code: Select all

    TOTALCMD#BAR#DATA
    *%COMMANDER_EXE%
    %Z/N %X"%P" "%T"
    %COMMANDER_PATH%\TCMADM64.EXE
    TC as Admin || Start separate TC instance with admin rights... |Administrator^ appears in title bar |*%COMMANDER_EXE% %Z/N %X"%P" "%T"|https://ghisler.ch/board/viewtopic.php?t=49620
    
    
    -1
  5. Double-click on the file: WindowsExplorer_To_TotalCommander_ON.reg and confirm the prompt with click on the "Yes" button
  6. Confirm the successful registration by clicking on the "OK" button after the displayed text has been checked!
  7. Exit Total Commander instance as administrator at this point
  8. After double-clicking on a folder in Windows Explorer, this folder is opened in the active panel in Total Commander!
    TOTALCMD64.EXE /O /A /S "%1"
     
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
     
  9. OPTION: Determine the location in the registry database
    1. Start Total Commander as administrator(!) with the button above and confirm the User Account Control (UAC) query
    2. Enter regedit.exe in the Total Commander command line, then press the ENTER key to open the "Registry Editor".
      • Computer\HKEY_CLASSES_ROOT\Directory\shell\open ... "open" has been created
      • Computer\HKEY_CLASSES_ROOT\Directory\shell\open\command
        ... "command" was created with this command: C:\totalcmd\TOTALCMD64.EXE /O /A /S "%1"
      • Computer\HKEY_CLASSES_ROOT\Drive\shell\open ... "open" has been created
      • Computer\HKEY_CLASSES_ROOT\Drive\shell\open\command
        ... "command" was created with this command: C:\totalcmd\TOTALCMD64.EXE /O /A /S "%1"
      • Create an entry in the "Favourites" menu so that you can find the place more easily later, e.g.
        - WindowsExplorer_To_TotalCommander_ON_HKCR-Directory-shell-open-command
        - WindowsExplorer_To_TotalCommander_ON_HKCR-Drive-shell-open-command
      • "Registry Editor" -> File - Exit
    3. Exit Total Commander instance as administrator
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
     
  10. See also: Set TC as default file manager? for further explanations, e.g.
    1. Horst.Epp wrote: 2016-05-20, 11:57 UTCIt works perfectly in Winows 7, 8.1 and Windows 10 for me.
    2. Horst.Epp wrote: 2016-05-15, 15:03 UTC DE: Der Arbeitsplatz und die Systemsteuerung werden absichtlich nicht angetastet !
      EN: The workplace and the control panel are deliberately not touched!
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
     
  11. .reg file to RESTORE THE DEFAULT SETTINGS -> ATTENTION: This is NOT possible with this code! -> Solution: Point 12.!
    1. Copy the code linked here into an empty file from a text editor: https://www.ghisler.ch/board/viewtopic.php?p=427330#p427330
    2. Save the file in a text editor as a .reg file - file name, e.g: WindowsExplorer_To_TotalCommander_OFF.reg
    3. Start Total Commander as administrator (e.g. with the button above) and confirm the UAC request.
    4. Double-click on the file: WindowsExplorer_To_TotalCommander_OFF.reg and confirm the prompt with click on the "Yes" button
    5. Confirm the de-registration by clicking on the "OK" button. *)
    6. Double-clicking on a folder in Windows Explorer should bring it back to Windows Explorer instead of Total Commander open
    7. *) These entries were NOT removed from the registry:
      1. Computer\HKEY_CLASSES_ROOT\Directory\shell\open
      2. Computer\HKEY_CLASSES_ROOT\Directory\shell\open\command
        ... "command" folder with command: C:\totalcmd\TOTALCMD64.EXE /O /A /S "%1"
      3. Computer\HKEY_CLASSES_ROOT\Drive\shell\open
      4. Computer\HKEY_CLASSES_ROOT\Drive\shell\open\command
        ... "command" folder with command: C:\totalcmd\TOTALCMD64.EXE /O /A /S "%1"
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
     
  12. MANUAL REMOVAL OF ENTRIES in the registration database (registry) - see also point 11.g. above.
    1. Important note: All manual changes to the registry are made at your own risk!
      It is therefore highly recommended to create a BACKUP of the registry database BEFOREhand!
    2. Start Total Commander as administrator(!) with the button above and confirm the User Account Control (UAC) query
    3. Enter regedit.exe in the Total Commander command line, then press the ENTER key to open the "Registry Editor".
    4. If "Favourites" were previously created, these can now be called up individually
      • Favourite: WindowsExplorer_To_TotalCommander_ON_HKCR-Directory-shell-open-command
        Target: Computer\HKEY_CLASSES_ROOT\Directory\shell\open\command
      • Favourite: WindowsExplorer_To_TotalCommander_ON_HKCR-Drive-shell-open-command
        Target: Computer\HKEY_CLASSES_ROOT\Drive\shell\open\command
    5. Delete the entries ...\open\command (Computer\HKEY_CLASSES_ROOT\Directory\shell\open\command) as follows:
      Right click on "open" -> Delete -> confirm the query "Do you want to delete this key and its subkey permanently?" with a click on "Yes"
    6. Delete the entries ...\open\command (Computer\HKEY_CLASSES_ROOT\Drive\shell\open\command) as follows:
      Right click on "open" -> Delete -> confirm the query "Do you want to delete this key and its subkey permanently?" with a click on "Yes"
    7. "Registry Editor" -> Menu "File" - "Exit"
    8. Exit Total Commander instance as administrator
    9. Double-clicking on a folder in Windows Explorer will bring it back to Windows Explorer instead of Total Commander open
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
     
  13. Google Search:

    Code: Select all

    default file explorer site:ghisler.ch
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
Deutsch (German): Total Commander x64 zum Standard-Dateiexplorer machen
Aus Interesse habe ich das erfolgreich in Total Commander x64 eingerichtet. (Beschreibung in deutscher und oben in englischer Sprache).
Im deutschen Text wurden nur Teilformatierungen übernommen. Es empfiehlt sich gegebenenfalls diesen Beitrag nochmals mit Strg+Klick
auf den Link in einem weiteren Browser-Fenster zu öffnen um bei Zweifelsfällen die "Originalformatierung" zur Verfügung zu haben.
  1. Den hier verlinkten Code [oder unter Punkt 3.] in eine leere Datei von einem Texteditor kopieren.
  2. Die Datei in einem Texteditor speichern als .reg Datei - Dateiname, zB: WindowsExplorer_To_TotalCommander_ON.reg
    1. Windows-Editor 11.2210.5.0 - Dateiname: WindowsExplorer_To_TotalCommander_ON.reg
    2. Notepad3: Datei - Speichern unter... - Dateiname: WindowsExplorer_To_TotalCommander_ON.reg
    3. EmEditor Pro: Datei - Speichern unter... - Dateityp: Ini (*.ini;*.inf;*.reg) - Dateiname: WindowsExplorer_To_TotalCommander_ON.reg
  3. Den im Code angeführten Pfad in Zeile 9 und 17 zu TOTALCMD64.exe an den eigenen Pfad [und CODE] anpassen - Beispiel:
    VON: @="c:\\tools\\wincmd\\TOTALCMD64.EXE /O \"%1\"" ... dies ist der Pfad im Forumsbeitrag: c:\tools\wincmd\ ... öffnet Ordner im linken TC-Fenster
    AUF: @="C:\\totalcmd\\TOTALCMD64.EXE /O /A /S \"%1\"" ........ dies ist mein Installationspfad ....: c:\totalcmd\ ... öffnet Ordner im aktiven TC-Fenster
    WindowsExplorer_To_TotalCommander_ON.reg - Beispiel für Installationspfad: c:\totalcmd\

    Code: Select all

    Windows Registry Editor Version 5.00
     
     [HKEY_CLASSES_ROOT\Drive\shell]
     @="open"
     
     [HKEY_CLASSES_ROOT\Drive\shell\open]
     
     [HKEY_CLASSES_ROOT\Drive\shell\open\command]
     @="C:\\totalcmd\\TOTALCMD64.EXE /O /A /S \"%1\""
     
     [HKEY_CLASSES_ROOT\Directory\shell]
     @="open"
     
     [HKEY_CLASSES_ROOT\Directory\shell\open]
     
     [HKEY_CLASSES_ROOT\Directory\shell\open\command]
     @="C:\\totalcmd\\TOTALCMD64.EXE /O /A /S \"%1\""
    
  4. Total Commander mit nachfolgendem Button als Administrator(!) starten und die Benutzerkontensteuerung (UAC)-Abfrage bestätigen:
    Total Commander als Administrator ausführen -> kopiere diesen Code und füge ihn in die Buttonbar ein

    Code: Select all

    TOTALCMD#BAR#DATA
    *%COMMANDER_EXE%
    %Z/N %X"%P" "%T"
    %COMMANDER_PATH%\TCMADM64.EXE
    TC as Admin || Start separate TC instance with admin rights... |Administrator^ appears in title bar |*%COMMANDER_EXE% %Z/N %X"%P" "%T"|https://ghisler.ch/board/viewtopic.php?t=49620
    
    
    -1
  5. Führe einen Doppelklick auf die Datei: WindowsExplorer_To_TotalCommander_ON.reg durch und bestätige die Abfrage mit Klick auf den "Ja" Button
  6. Bestätige die erfolgreiche Registrierung mit einem Klick auf den "OK" Button nachdem der angezeigte Text geprüft wurde!
  7. Beende an dieser Stelle die Total Commander als Administrator-Instanz (Dateien - Exit)
  8. Nach einem Doppelklick auf einen Ordner im Windows Explorer wird dieser Ordner im aktiven Fenster in Total Commander geöffnet!
    TOTALCMD64.EXE /O /A /S "%1"
     
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
     
  9. OPTION: Ermittle den Speicherort in der Registrierungsdatenbank
    1. Total Commander mit obigem Button als Administrator(!) starten und die User Account Control (UAC)-Abfrage bestätigen:
    2. regedit.exe eingeben in der Total Commander Kommandozeile, dann die ENTER-Taste drücken öffnet den "Registrierungs-Editor"
      • Computer\HKEY_CLASSES_ROOT\Directory\shell\open ... "open" wurde angelegt
      • Computer\HKEY_CLASSES_ROOT\Directory\shell\open\command
        ... "command" wurde mit Befehl: C:\totalcmd\TOTALCMD64.EXE /O /A /S "%1" angelegt.
      • Computer\HKEY_CLASSES_ROOT\Drive\shell\open ... "open" wurde angelegt
      • Computer\HKEY_CLASSES_ROOT\Drive\shell\open\command
        ... "command" wurde mit Befehl: C:\totalcmd\TOTALCMD64.EXE /O /A /S "%1" angelegt.
      • OPTION: Erstelle jeweils einen Eintrag im Menü "Favoriten", damit Du die Stelle später leichter findest, zB
        - WindowsExplorer_To_TotalCommander_ON_HKCR-Directory-shell-open-command
        - WindowsExplorer_To_TotalCommander_ON_HKCR-Drive-shell-open-command
      • "Registrierungs-Editor" -> Datei - Beenden
      • Beende die Total Commander als Administrator Instanz
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
     
  10. Siehe auch: Set TC as default file manager? für weitere Erläuterungen, zB
    1. Horst.Epp wrote: 2016-05-20, 11:57 UTCDE: Es funktioniert perfekt für mich in Windows 7, 8.1 und Windows 10.
      EN: It works perfectly in Winows 7, 8.1 and Windows 10 for me.
    2. Horst.Epp wrote: 2016-05-15, 15:03 UTC DE: Der Arbeitsplatz und die Systemsteuerung werden absichtlich nicht angetastet !
      EN: The workplace and the control panel are deliberately not touched!
     
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
     
  11. .reg-Datei, um die STANDARDEINSTELLUNGEN WIEDERHERZUSTELLEN | ACHTUNG: Das ist mit diesem Code NICHT möglich! - Lösung: Siehe Pkt. 12.
    1. Den hier verlinkten Code in eine leere Textdatei kopieren: https://www.ghisler.ch/board/viewtopic.php?p=427330#p427330
    2. Die Textdatei in einem Texteditor speichern als .reg Datei - Dateiname, zB: WindowsExplorer_To_TotalCommander_OFF.reg
    3. Total Commander als Administrator starten (zB mit Button wie oben angeführt) und die UAC-Abfrage bestätigen
    4. Führe einen Doppelklick auf die Datei: WindowsExplorer_To_TotalCommander_OFF.reg durch und bestätige die Abfrage mit Klick auf den "Ja" Button
    5. Bestätige die De-Registrierung mit einem Klick auf den "OK" Button. *)
    6. Nach einem Doppelklick im Windows Explorer auf einen Ordner sollte dieser wieder in Windows Explorer, anstatt in Total Commander geöffnet werden
    7. *) In der Registry wurden diese Einträge NICHT entfernt:
      1. Computer\HKEY_CLASSES_ROOT\Directory\shell\open
      2. Computer\HKEY_CLASSES_ROOT\Directory\shell\open\command ... "command" mit Befehl: C:\totalcmd\TOTALCMD64.EXE /O "%1"
      3. Computer\HKEY_CLASSES_ROOT\Drive\shell\open
      4. Computer\HKEY_CLASSES_ROOT\Drive\shell\open\command ... "command" mit Befehl: C:\totalcmd\TOTALCMD64.EXE /O "%1"
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
     
  12. MANUELLE ENTFERNUNG VON EINTRÄGEN in der Registrierungsdatenbank (Registry) - siehe auch Punkt 11.g. oben.
    1. Wichtiger Hinweis:: Sämtliche manuellen Änderungen in der Registry erfolgen auf eigene Gefahr!
      Es empfiehlt sich daher sehr VORHER ein BACKUP der Registrierungsdatenbank anzulegen!
    2. Total Commander mit Button gemäß Punkt 4. oben als Administrator starten und die Benutzerkontensteuerungsabfrage (UAC) bestätigen.
    3. In der Kommandozeile von Total Commander als ADMIN folgendes eingeben und ENTER drücken: regedit.exe
    4. Sofern zuvor "Favoriten" angelegt wurden, können diese jetzt einzeln aufgerufen werden
      • Favorit: WindowsExplorer_To_TotalCommander_ON_HKCR-Directory-shell-open-command
        Ziel: Computer\HKEY_CLASSES_ROOT\Directory\shell\open\command
      • Favorit: WindowsExplorer_To_TotalCommander_ON_HKCR-Drive-shell-open-command
        Ziel: Computer\HKEY_CLASSES_ROOT\Drive\shell\open\command
    5. Löschung der Einträge ...\open\command (Computer\HKEY_CLASSES_ROOT\Directory\shell\open\command) wie folgt:
      Rechtsklick auf "open" -> Löschen -> die Abfrage "Möchten Sie diesen Schlüssel und dessen Unterschlüssel endgültig löschen?" mit Klick auf "Ja" bestätigen
    6. Löschung der Einträge ...\open\command (Computer\HKEY_CLASSES_ROOT\Drive\shell\open\command) wie folgt:
      Rechtsklick auf "open" -> Löschen -> die Abfrage "Möchten Sie diesen Schlüssel und dessen Unterschlüssel endgültig löschen?" mit Klick auf "Ja" bestätigen
    7. "Registrierungs-Editor" -> Menü "Datei" - "Beenden"
    8. Total Commander instance as administrator beenden
    9. Nach einem Doppelklick im Windows Explorer auf einen Ordner wird dieser wieder in Windows Explorer, anstatt in Total Commander geöffnet
         ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
      
  13. Google Suche:

    Code: Select all

    default file explorer site:ghisler.ch
     

Windows 11 Pro (x64) Version 22H2 (OS build Build 22621.1344) | TC 10.52 x64/x86
Last edited by tuska on 2023-03-03, 16:42 UTC, edited 3 times in total.
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Make Total Commander default file explorer

Post by *pplupo »

I've been down this path but it seems some programs such as "Open Containing Folder" on Notepad++ or "Show in Folder" (Chrome's downloads) insist in calling Windows Explorer directly.

Right now I'm working on an AHK script that detects an explorer window opening and replaces it with TCMD. It's working so far, but I'm missing an option to open TCMD with a specific file selected.
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Re: Make Total Commander default file explorer

Post by *tuska »

2pplupo
Perhaps the tool "QuickSwitch" would be of interest to you.
NotNull wrote: 2021-03-22, 20:05 UTC What does QuickSwitch do? - the short version
When in a file dialog, like Save As .. or Open ... , it can switch that dialog to any folder that is opened in a file manager.
Currently supported file managers: File Explorer, Directory Opus, Total Commander and XYPlorer.
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Make Total Commander default file explorer

Post by *pplupo »

Thank you, tuska! It is interesting! :-)

I was able to finalize the script and, right now, I can open TCMD with a file selected if Windows Explorer has a file selected, or just go to the directory if there's no file selected. I was also able to open special folders, such as Recycle Bin and Network, without compromising the Control Panel and other explorer instances opened by the Control Panel (like the mouse properties). So far, everything is working as I wanted. :-) This is the closest I could get to replacing Windows Explorer.
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Re: Make Total Commander default file explorer

Post by *tuska »

2pplupo
Glad it works for you. :)
-----------

I have edited my post above and added further details to correct/complete the topic.
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Make Total Commander default file explorer

Post by *pplupo »

Here is my AutoHotKey script.
Whenever Windows Explorer is executed, it is replaced by TCMD, adding a tab to an existing instance or executing TCMD and then adding the tab.
If a file is selected in Windows Explorer, it will be selected in TCMD.
It works with special folders such as Network and Recycle Bin.
It doesn't interfere with Control Panel (as far as I could test it).

If anyone wants to give it a shot, please let me know about any issues.
I think I my try compiling it so other people don't have to install autohotkey just for this.

Code: Select all

;#NoTrayIcon
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
#SingleInstance Force
#Persistent

TCMD := "C:\totalcmd\TOTALCMD64.EXE"

Loop
{
	WinWait, ahk_class CabinetWClass
	WinGetTitle, title, A
	ID := WinExist() ; without parameters use the LastFound window by default; WinExist() returns the Unique ID (HWND) of the first matching window
	WinGet, winid
	Path := uriDecode(getSpecialFolderPath(%winid%))
	WinGetClass Class, ahk_id %HWnd%
	if (Path != "")
	{
		;TCMD doesn't fully support Control Panel, hiding some items.
		;https://www.autohotkey.com/docs/v1/misc/CLSID-List.htm
		if (!InStr(Path,"::{26EE0668-A00A-44D7-9371-BEB064C98683}"))
		{
			WinClose, %ahk_id%
			Run, %TCMD% /O /T /S "%Path%", PID
		}
	}
	Else
	{
		Path := Explorer_Get(%ahk_id%, true)
		if (Path != "" && Path != "ERROR") {
			WinClose, %ahk_id%
			Run, %TCMD% /P /O /T /S "%Path%", PID
		}
		Else
		{
			Path := Explorer_GetPath(%ahk_id%)
			if (Path != "" && Path != "ERROR") {
				WinClose, %ahk_id%
				Run, %TCMD% /O /T /S "%Path%", PID
			}
		}
		
	}
	Sleep 50
	WinActivate, A
	Sleep 100
}

getSpecialFolderPath(HWnd="") {
	If ( HWnd = "" ) {
		HWnd := WinExist("A")
	}
	WinGet Process, ProcessName, ahk_id %HWnd%
	If (Process = "explorer.exe")
	{
		WinGetClass Class, ahk_id %HWnd%
		If (Class ~= "(Cabinet|Explore)WClass")
		{
			For Window In ComObjCreate("Shell.Application").Windows
			{
				try
				{
					If ( Window.HWnd == HWnd )
					{
						windowDocument := Window.Document
						windowPath := windowDocument.Folder.Self.Path
						If (InStr(windowPath, "::") == 1)
						{
							Return windowPath
						}
					}
				}
			}
		}
	}
	Return ""
}

;[Great AutoHotkey script to URL Encode/Decode and parse URL parameters : AutoHotkey](https://www.reddit.com/r/AutoHotkey/comments/4py9e7/great_autohotkey_script_to_url_encodedecode_and/)
;***********https://autohotkey.com/board/topic/17367-url-encoding-and-decoding-of-special-characters/******************* 
uriDecode(str) {
	Loop
		If RegExMatch(str, "i)(?<=%)[\da-f]{1,2}", hex) {
				StringReplace, str, str, `%%hex%, % Chr("0x" . hex), All
		} Else {
			Break
		}

	Return, str
}

Explorer_Get(hwnd="",selection=false)
{
	if !(window := Explorer_GetWindow(hwnd))
		return ErrorLevel := "ERROR"
	if (window="desktop")
	{
		ControlGet, hwWindow, HWND,, SysListView321, ahk_class Progman
		if !hwWindow ; #D mode
			ControlGet, hwWindow, HWND,, SysListView321, A
		ControlGet, files, List, % ( selection ? "Selected":"") "Col1",,ahk_id %hwWindow%
		base := SubStr(A_Desktop,0,1)=="\" ? SubStr(A_Desktop,1,-1) : A_Desktop
		Loop, Parse, files, `n, `r
		{
			path := base "\" A_LoopField
			IfExist %path% ; ignore special icons like Computer (at least for now)
				ret .= path "`n"
		}
	}
	else
	{
		if selection
			collection := window.document.SelectedItems
		else
			collection := window.document.Folder.Items
		for item in collection
			ret .= item.path "`n"
	}
	return Trim(ret,"`n")
}

Explorer_GetWindow(hwnd="")
{
	; thanks to jethrow for some pointers here
    WinGet, process, processName, % "ahk_id" hwnd := hwnd? hwnd:WinExist("A")
    WinGetClass class, ahk_id %hwnd%
	
	if (process!="explorer.exe")
		return
	if (class ~= "(Cabinet|Explore)WClass")
	{
		for window in ComObjCreate("Shell.Application").Windows
			if (window.hwnd==hwnd)
				return window
	}
	else if (class ~= "Progman|WorkerW") 
		return "desktop" ; desktop found
}

Explorer_GetPath(hwnd="")
{
	if !(window := Explorer_GetWindow(hwnd))
		return ErrorLevel := "ERROR"
	if (window="desktop")
		return A_Desktop
	path := window.LocationURL
	path := RegExReplace(path, "ftp://.*@","ftp://")
	StringReplace, path, path, file:///
	StringReplace, path, path, /, \, All 
	
	; thanks to polyethene
	Loop
		If RegExMatch(path, "i)(?<=%)[\da-f]{1,2}", hex)
			StringReplace, path, path, `%%hex%, % Chr("0x" . hex), All
		Else Break
	return path
}
Post Reply