Skip to content

Context menu integration

Dax T Games edited this page Mar 12, 2023 · 12 revisions

👉 Tip! Cmder can automatically register itself in the context menu. To do so, you can follow the instructions from the README to create the shortcut to open Cmder in a chosen folder.

The registration of the context menu items is also possible through the Settings → Integration.

 

"Open Cmder Here" in context menu

To add an entry in the Windows Explorer context menu to open Cmder in a specific directory, a registry key needs to be added to Windows.

👉 Note: Before starting, make sure that %CMDER_ROOT% environment variable is correctly set.

Creating the entries

You can also manually create or edit the entry by fiddling with your registry.

  1. Create a new file named OpenCmderHere.reg (or any other name that ends in .reg extension).
  2. Paste the following into it, then 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\""

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

Editing the entries

  1. Open the Registry Editor. To do so, press Win + R → type regedit.exe and hit enter
  2. Go to the following key:
HKEY_CLASSES_ROOT\Directory\Background\shell
  1. Find the Cmder key, or create it if it doesn't exist.
  2. Modify the content according to the following values:

Path: [cmder_root]\Cmder.exe /start %v Icon file: [cmder_root]\icons\cmder.ico,0

Start in a new tab instead of new window

TBA: See #1645 for how to modify this behavior.

Advanced Shell Extension Setup

You can use the -- command line argument to pass any supported ConEmu command line argument to the shell extension:

  1. Create the CmderXtra.reg file below.
  2. Import it.
  3. Try out the shell extension.
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\ConEmu_Cmder]
@="ConEmu/Cmder Here"
"NoWorkingDirectory"=""
"Icon"="C:\\Users\\vagrant\\cmderdev\\icons\\cmder_red.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\ConEmu_Cmder\command]
@="\"C:\\Users\\vagrant\\cmderdev\\Cmder.exe\" -- -reuse -run {cmd::Cmder} -new_console:d:\"%V\":t:\"ConEmu - Cmder\" "

[HKEY_CLASSES_ROOT\Directory\shell\ConEmu_Cmder]
@="ConEmu/Cmder Here"
"NoWorkingDirectory"=""
"Icon"="C:\\Users\\vagrant\\cmderdev\\icons\\cmder_red.ico"

[HKEY_CLASSES_ROOT\Directory\shell\ConEmu_Cmder\command]
@="\"C:\\Users\\vagrant\\cmderdev\\Cmder.exe\" -- -reuse -run {cmd::Cmder} -new_console:d:\"%V\":t:\"ConEmu - Cmder\" "

[HKEY_CLASSES_ROOT\Drive\Background\shell\ConEmu_Cmder]
@="ConEmu/Cmder Here"
"NoWorkingDirectory"=""
"Icon"="C:\\Users\\vagrant\\cmderdev\\icons\\cmder_red.ico"

[HKEY_CLASSES_ROOT\Drive\Background\shell\ConEmu_Cmder\command]
@="\"C:\\Users\\vagrant\\cmderdev\\Cmder.exe\" -- -run {cmd::Cmder} -new_console:d:\"%V\""t:\"ConEmu - Cmde\" "

[HKEY_CLASSES_ROOT\Drive\shell\ConEmu_Cmder]
@="ConEmu/Cmder Here"
"NoWorkingDirectory"=""
"Icon"="C:\\Users\\vagrant\\cmderdev\\icons\\cmder_red.ico"

[HKEY_CLASSES_ROOT\Drive\shell\ConEmu_Cmder\command]
@="\"C:\\Users\\vagrant\\cmderdev\\Cmder.exe\" -- -reuse -run {cmd::Cmder} -new_console:d:\"%V\":t:\"ConEmu - Cmder\" "