Skip to content

Instantly share code, notes, and snippets.

@jojobyte
Last active November 5, 2024 02:36
Show Gist options
  • Save jojobyte/66c8346ed8948b9b395f to your computer and use it in GitHub Desktop.
Save jojobyte/66c8346ed8948b9b395f to your computer and use it in GitHub Desktop.
Cmder Context (Right-Click) Menu for Windows 7, 8, 10 & 11
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
@="Open Cmder Here"
"Icon"="C:\\tools\\cmder\\Cmder.exe,0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder\command]
@="\"C:\\tools\\cmder\\Cmder.exe\" \"%V\""
[HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@="Open Cmder Here"
"Icon"="C:\\tools\\cmder\\Cmder.exe,0"
[HKEY_CLASSES_ROOT\Directory\shell\Cmder\command]
@="\"C:\\tools\\cmder\\Cmder.exe\" \"%1\""
@fcruzel
Copy link

fcruzel commented Oct 26, 2018

Thanks for the help!

Just so anyone knows (i had this issue), if the above fix doesn't work and you find Cmder is always opening to your home directory, that's because it is set to in the Settings by default.

  1. In Settings -> Startup -> Tasks, select your default Task (probably cmd::Cmder - check or change in Settings -> Startup)
  2. It will look something like this cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:%USERPROFILE%
  3. Remove the portion :d:%USERPROFILE% <- Note the colon before d
  4. Result should be: cmd /k "%ConEmuDir%\..\init.bat" -new_console
  5. This will stop new tasks/command tabs from defaulting to your home directory.

Thanks!

@Koolstr
Copy link

Koolstr commented Nov 13, 2018

For anybody else still having this problem, here's the clear steps which got it to work as intended for me. With this, Cmder is in the context menu, opens as a new tab instead of new window, opens correctly to the selected directory that was right clicked in, and opens the correct console task.

- Add Cmder to the context menu:
In Cmder install directory (default is C;/tools/), run "cmder.exe /REGISTER ALL" in Command Prompt

- Patch context menu to open in single window:
In RegEdit, in "Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder\command", change to "C:\tools\Cmder\Cmder.exe" /SINGLE "%V" (Setting Single Instance Mode in Cmder Settings doesn't seem to be working)

- Create Default Task with Desired Console:
For me, ConEmu is too slow to load, so I set the default to the regular Command Prompt. Here's how:

  1. Cmder Settings -> Startup -> Tasks -> +. Set as Default task for new console (and default shell if desired).
  2. Add as a Command, the path to standard CMD, which is "C:\Windows\System32\cmd.exe". Alternatively, add this dynamically using the "File path..." button. Save settings.
  3. If you get a popup, choose the new task, and leave the default directory blank (this way, opening from the context menu opens in the selected directory. If you want a default directory, create a separate, non-default task).

- Set Default Task to New Task:
This is the step that will most often be forgotten. Go to Cmder Settings -> Startup. Set Specified named task to your new default.

That's it! It should all work as intended now. Honestly, the need for such a convoluted workaround is ridiculous. Why has context menu integration not been added as a UI toggle, and why must the means for setting new tabs instead of windows, the default task, and opening in the right directory, be so convoluted?

@digeomel
Copy link

digeomel commented Jan 7, 2019

I'm using bash and I wanted to re-use my existing cmder window. What did it for me, after @jp9573 's answer, is this:
-reuse -run {bash} -cur_console:n:d:"%v"

@thucminhpham
Copy link

this change in setting from
chriswiduta blog works for win7

{bash} -cur_console:n:d:"%V"

thank so much
cheers

@chrisblacea
Copy link

image

Help please?

@jojobyte
Copy link
Author

image

Help please?

Remove the space maybe?

@chrisblacea
Copy link

Im good now. Thanks! :)

@theer1k
Copy link

theer1k commented Jun 29, 2019

Very much thanks fellow!

@kxdang
Copy link

kxdang commented Jul 26, 2019

Thank you very much! worked perfectly!

@MatinHz
Copy link

MatinHz commented Jul 29, 2019

Thanks!

@svaneg11
Copy link

svaneg11 commented Aug 8, 2019

Worked great, thanks!

@elVengador
Copy link

Thanks .*)

@JoshMatthew
Copy link

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.

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.

This solved my permission problem! thanks!

@ybg345
Copy link

ybg345 commented Aug 15, 2020

Executing .\cmder.exe /REGISTER ALL works fine while opening up Cmder in windows right click context menu. But by default Cmder is not opening as Administrator. Can someone tell how to open cmder as Administrator every time we open it from context menu (right click)?

@jatinpatel136
Copy link

select settings > general => then select cmder as admin
image

@ybg345
Copy link

ybg345 commented Aug 21, 2020

select settings > general => then select cmder as admin
image

That's so cool. Thank you.

@vlbn
Copy link

vlbn commented Sep 2, 2020

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.

👍😎 PERFECT!

@fedeul
Copy link

fedeul commented Oct 10, 2020

🙌 Thanks!

@oxk4r01
Copy link

oxk4r01 commented Nov 8, 2020

.\cmder.exe /REGISTER ALL

Great! Thank you :)

@oxk4r01
Copy link

oxk4r01 commented Nov 8, 2020

After .\cmder.exe /REGISTER ALL, could it be possible to assign a hotkey to it?

@jeferandom
Copy link

Thank you

@secp8x32
Copy link

Thanks a lot :)

@shawon39
Copy link

shawon39 commented Apr 21, 2021

You can go to Settings > Integration and set this in the command field (upper section).

{cmder} -cur_console:n:d:"%V"

Click on the Register > Save settings

image

@euedeep
Copy link

euedeep commented Jun 21, 2021

No need to do anything like this! Simply we can add Cmder and it will open at our particular path from where we open it.!

You can go to Settings > Integration and set this in the command field (upper section).

{bash} -cur_console:n:d:"%V"
%V is used to pass the current directory you are in.

After that, you just need to hit the Register button in the upper section.
image

mantul

{Shells::cmd (Admin)} -cur_console:n:d:"%V"

@abdes-zakari
Copy link

Easy way:

  • Open a terminal as an Administrator.
  • Navigate to the directory you have placed Cmder.
  • Execute .\cmder.exe /REGISTER ALL

@SkyGra
Copy link

SkyGra commented Aug 23, 2021

Easy way:

  • Open a terminal as an Administrator.
  • Navigate to the directory you have placed Cmder.
  • Execute .\cmder.exe /REGISTER ALL

Thanks, it does work.

@lawweiliang
Copy link

Easy way:

  • Open a terminal as an Administrator.
  • Navigate to the directory you have placed Cmder.
  • Execute .\cmder.exe /REGISTER ALL

Yeah, this is easy and straightforward. Thanks, brother.

@sergioabreu-g
Copy link

If you update to Windows 11 you will have to disable and enable it again. Also, it will not appear in the main context menu, but under the "Show more options" submenu due to the W11 new context menu design.

@elisim
Copy link

elisim commented Jun 28, 2022

Tested on windows 11 and works :)

@amirhossein-fzl
Copy link

@jojobyte
If you can use environment variables, it will be great. For example :

"%CMDER_ROOT%\\Cmder.exe"

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