Andrew Moore


Thoughts, stories, ideas, and answers to questions posed to me.

Tags


Andrew Moore

Adding Cmder to the Windows Explorer Context Menu

2nd October 2015

I recently received an email from a designer in the UK asking me if I knew how to add Cmder to the Windows Explorer context menu, so that when you navigate to your project folder in Windows Explorer (such as c:\projects\client_a), you can right click within the folder and choose an option that reads "Open in Cmder." As it turned out, I did know how to do this, and I think it is high time I share it with the world.

The first thing we need to do is ensure we know where Cmder.exe is. If you followed my recommendation in my "Setting Up Git & Cmder" post, your Cmder executable will be located at c:\cmder\Cmder.exe, so keep this location in mind as we work with our context menu-enabling Registry Data File.

CAVEATS: This tutorial and associated files will only work on Windows Vista and higher (7, 8, 8.1, and 10). Also, if your default shell in Cmder is PowerShell (and not say, git bash or cmd), then this may not necessarily work for you.

Install Option 1: Simple Mode

The simple mode is perfect for anyone short on time, and who has their Cmder.exe file in my recommended location (c:\cmder\). If you do not have Cmder.exe in this location, jump down to Install Option 2: Manual Mode.

  1. Download (Right-Click and "Save As…") the following Registry Data Files to your computer (anywhere you can find them will do):
  2. To enable the context menu item, double-click the cmder_context_enable.reg file that you downloaded.
    1. For the User Account Control popup, "Do you want to allow this app/program to make changes to your PC?"Click Yes.
    2. For the Registry Editor popup, "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in […]\cmder_context_enable.reg, do not add it to the registry. Are you sure you want to continue?"Click Yes.
    3. You should now have successfully added the registry entries for Cmder to appear in your context menus within folders. For the Registry Editor popup, "The keys and values contained in […]\cmder_context_enable.reg have been successfully added to the registry."Click OK.
  3. You can now open any folder on your system, right-click within the folder, and select the new option, "Open in Cmder."
Install Option 2: Manual Mode

This mode is for those who do not have Cmder.exe located in c:\cmder\ or who just want to try their hand at doing it the old fashioned way (using copy, paste, and find/replace!).

Creating cmder_context_enable.reg
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\cmder]
@="Open in Cmder"
"Icon"="C:\\cmder\\Cmder.exe,0"

[HKEY_CLASSES_ROOT\Directory\Background\shell\cmder\command]
@="\"C:\\cmder\\Cmder.exe\" \"%V\""

[HKEY_CLASSES_ROOT\Directory\shell\cmder]
@="Open in Cmder"
"Icon"="C:\\cmder\\Cmder.exe,0"

[HKEY_CLASSES_ROOT\Directory\shell\cmder\command]
@="\"C:\\cmder\\Cmder.exe\" \"%1\""
  1. Copy the above code for cmder_context_enable.reg and paste it into your preferred text editor.
  2. Determine where on your system Cmder.exe exists. For example, you may have your Cmder executable located in C:\Program Files (x86)\Cmder\. Take note of the file path.
  3. In your text editor do a Find/Replace where you are finding all instances of C:\\cmder (yes, the extra backslash '\' is important) and replacing it with your own path to Cmder.exe (ensure every backslash is doubled just like mine was), for example: C:\\Program Files (x86)\\Cmder.
  4. Once you have replaced every instance of C:\\cmder with your path to Cmder.exe, go ahead and save the file as cmder_context_enable.exe somewhere on your computer where you can easily find it.
  5. Now, double-click cmder_context_enable.exe and accept all following alerts and prompts. Should everything go smoothly, you will now be able to right-click within any folder and choose the "Open in Cmder" option.
Creating cmder_context_disable.reg
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\Background\shell\cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\cmder]
  1. Copy and paste the above code into your preferred text editor and save it as cmder_context_disable.reg alongside your enable script.
  2. To disable the context menu option, "Open in Cmder," double-click this file and accept all following prompts.

Wrap-Up

In this article I provided the steps and files that will allow you to add Cmder to your Windows Explorer context menu, making it easier for you to open a given folder directly in your preferred shell in Cmder. Check out my other post detailing how to set up Git & Cmder if you hadn't already, and as always: Thank you for reading.

If you have any comments or questions about this article, or are interested in me writing an article about another topic or issue you are curious about or needing help with, feel free to shoot me an email: and...@awmoore.com

Andrew Moore
AUTHOR

Andrew Moore

Not your typical IT guy – a unicorn if you will – with a love for the outdoors, technology, security, and keeping end-users happy (and in line). INTP.

View Comments