Skip to content

Instantly share code, notes, and snippets.

@hamzahamidi
Last active February 23, 2024 01:30
Show Gist options
  • Save hamzahamidi/ce00cdc5895480b9d538093bdeda4334 to your computer and use it in GitHub Desktop.
Save hamzahamidi/ce00cdc5895480b9d538093bdeda4334 to your computer and use it in GitHub Desktop.
"Open Cmder Here" in context menu

"Open Cmder Here" in context menu

Edit 04/2021:

As of the lastest versions, just execute the following command .\cmder.exe /REGISTER ALL per Documentation.

Original Solution

To add an entry in the Windows Explorer context menu to open Cmder in a specific directory, paste this into a OpenCmderHere.reg file and double-click to install it.

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
    @="Open Cmder Here"
    "Icon"="\"%CMDER_ROOT%\\icons\\cmder.ico\",0"

    [HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder\command]
    @="\"%CMDER_ROOT%\\Cmder.exe\" /START \"%v\""

Then add the Environment variable CMDER_ROOT to point to the path of your installation.

System Settings Environment Variable

After adding this, a restart of the explorer might be required to make it work.

Execute .\cmder.exe /REGISTER ALL If you get a message "Access Denied" ensure you are executing the command in an Administrator prompt.

@hamzahamidi
Copy link
Author

@viclafouch just read carefully the steps. If you got this error that's just mean you re not running cmder in administrator mode.

@khew81
Copy link

khew81 commented Nov 15, 2020

.\cmder.exe /REGISTER ALL

May I ask what this command is actually doing? This fixed my access denied issue but I just want to understand it.

@hamzahamidi
Copy link
Author

It registers a Windows Shell Menu shortcut. You can check cmder documentation here

@masidiq
Copy link

masidiq commented Dec 4, 2020

Its working thank you :)

image

@Bahodir8586
Copy link

I couldn't find OpenCmderHere.reg file. Can someone help me please

@mannyanebi
Copy link

Worked for me.

@mannyanebi
Copy link

I couldn't find OpenCmderHere.reg file. Can someone help me please

You'd have to create a new txt file, paste the code into it, rename it and run the registry file

@amaridansface
Copy link

image
When I click the Cmder Here, it gives me this... should I have saved the .reg somewhere in particular?

@StokicDusan
Copy link

Worked perfectly, Thank you!

@shakilsmash
Copy link

What do you mean with "Execute .\cmder.exe /REGISTER ALL ". How it can executed?

Open your windows command prompt in administrative mode
-> change directory to the cmder.exe folder
-> run the above command

@sistla001
Copy link

Is it possible to open it as a new tab (if an instance is already running) instead of opening it in a new window every time?

@romanripari
Copy link

image
not for me :(

It works if you don't use caps for /register. The command is .\cmder.exe /register ALL

@maya-hamdan
Copy link

Thanks a lot that helped me so much <3 <3

@maya-hamdan
Copy link

Thanks a lot that helped me so much <3 <3

but when the cmder is opened in the file the path isn't the current file path
image

@tumelo-mapheto
Copy link

Thank you

@MobCat
Copy link

MobCat commented Jun 14, 2021

Works grate on windows 7...
didn't have to restart but did have to use the
.\cmder.exe /REGISTER ALL
command with windows CMD as admin in the cmder folder first, then the context menu and cmder works fine.
Thanks again, and kinda odd this app doesn't have a setting for this as this seems to be a very commonly asked about feature.

@jeremyj563
Copy link

jeremyj563 commented Jun 29, 2021

I'm surprised no one has pointed out that no .reg file or environment variable is necessary for this. All that's needed is to run
cmder.exe /REGISTER [ALL, USER]

Per the documentation: https://github.com/cmderdev/cmder#cmderexe-command-line-arguments

image

@nimit2801
Copy link

Worked perfectly thank you! @hamzahamidi

@snk0911
Copy link

snk0911 commented Oct 20, 2021

What I noticed is that it is not needed to make the registry file. Just use the command \REGISTRY ALL on Cmder that's it!

@hyfydistro
Copy link

I'm surprised that no one has pointed that no .reg file or environment variable is necessary for this. All that's needed is to run cmder.exe /REGISTER [ALL, USER]

Per the documentation: https://github.com/cmderdev/cmder#cmderexe-command-line-arguments

image

I'm surprised few read this line

Shortcut to open Cmder in a chosen folder
Open a terminal as an Administrator
Navigate to the directory you have placed Cmder
Execute .\cmder.exe /REGISTER ALL If you get a message "Access Denied" ensure you are executing the command in an Administrator prompt.
In a file explorer window right click in or on a directory to see "Cmder Here" in the context menu.

Source: https://github.com/cmderdev/cmder#shortcut-to-open-cmder-in-a-chosen-folder

@hamzahamidi
Copy link
Author

I'm surprised that no one has pointed that no .reg file or environment variable is necessary for this. All that's needed is to run cmder.exe /REGISTER [ALL, USER]
Per the documentation: https://github.com/cmderdev/cmder#cmderexe-command-line-arguments
image

I'm surprised few read this line

Shortcut to open Cmder in a chosen folder
Open a terminal as an Administrator
Navigate to the directory you have placed Cmder
Execute .\cmder.exe /REGISTER ALL If you get a message "Access Denied" ensure you are executing the command in an Administrator prompt.
In a file explorer window right click in or on a directory to see "Cmder Here" in the context menu.

Source: https://github.com/cmderdev/cmder#shortcut-to-open-cmder-in-a-chosen-folder

Simply because it didn't exist in the previous versions. Additionally, The answer has been updated.

@jambi2
Copy link

jambi2 commented Nov 22, 2021

thank you thank you thank you :)

@Zguive
Copy link

Zguive commented Mar 19, 2022

Thx, it works 4 me ;)

@Zorgatone
Copy link

Can you modify it to also be displayed and work when you right click on non-opened folder instead of on the explorer panel background?

I mean like this (see the open in terminal and git gui, when a folder is selected from the list, but open in Cmder is missing)

image

Right clicking on the panel background of the explorer window, when inside a opened folder works as expected:

image

@max-white
Copy link

Is it possible to open it as a new tab (if an instance is already running) instead of opening it in a new window every time?

funnily it worked out of the box when i used the quake style terminal option but without it is not working for me aswell.

@omasseau
Copy link

omasseau commented Apr 5, 2023

Installing the entry works well, but the problem it that each time I launch "Cmder here" it asks me for the admin username and password. So it seems it always try to launch cmder with admin access.

Here is the command it tries to launch :

image

Notice the /ADMIN

@omasseau
Copy link

omasseau commented Apr 5, 2023

Installing the entry works well, but the problem it that each time I launch "Cmder here" it asks me for the admin username and password. So it seems it always try to launch cmder with admin access.

Here is the command it tries to launch :

image

Notice the /ADMIN

I fixed it by selecting "Specifed name task" (I previously add it on "Auto save/restore opened tabs").
Then I relaunched Cmdr and set it back to "Auto save/restore opened tabs" :

image

I guess it tried to restore a tab that was opened in admin mode before I added the context menu entry.

@ZhaoYitong
Copy link

@viclafouch just read carefully the steps. If you got this error that's just mean you re not running cmder in administrator mode.

Thank u, bro

@ChrysJ
Copy link

ChrysJ commented Nov 26, 2023

It works! Thanks a lot

@iamtheasad
Copy link

iamtheasad commented Feb 23, 2024

.\cmder.exe /REGISTER ALL just copy and paste these code on cmder before that you need to open cmder as administrator mode that's it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment