Wednesday, February 4, 2015

Setting Context Menu without Admin Privileges on Windows


If you are like mw, your company doesnt give you admin access to your Windows PC. This prevents you from customizing your PC for productivity.

Two things that I frequently use on Window are shortcuts from teh Windows Explorer menu to

  • Open my favorite editor - Notepad++ or Sublime Text 3
  • Open a command prompt at a directory - I use ConEmu

You can typically add these by adding a "command" key under


  • HKEY_CLASSES_ROOT\*\shell\"My Command Title"\command &
  • HKEY_CLASSES_ROOT\Dir\shell\"My Command Title"\command respectively

However without admin access you cannot add those keys in the registry

The good thing is that the HKEY_CLASSES_ROOT key provides a merged view of HKEY_LOCAL_MACHINE\Software\Classes and HKEY_CURRENT_USER\Software\Classes. So as a standard (non-admin) user you should have access to the later key.

You can add the commands you need to the following instead
  • HKEY_CURRENT_USER\Software\Classes\*\shell\"My Command Title"\command &
  • HKEY_CURRENT_USER\Software\Classes\Dir\shell\"My Command Title"\command respectively


Add "Edit with Notepad++" to context menus for all files


I find it very useful to be able to edit a file from the windows explorer with Notepad++ using the context menu. While I can drag the file into a open Notepad++ window, I dont always have Notepad++ open. Also I find it easier to use the context menu rather than find the window and drag the file there

Lets add a context menu item to open the file using Notepad++

My Notepad++.exe is located in c:\MyBin\Notepad++\Notepad++.exe. You will need the full path name to the exe

Since we are adding to the menu for any file, regardless of type, the Registry key of interest is HKEY_CURRENT_USER\Software\Classes\*\shell

Here is the procedure:
  1. Using Regedit, navigate to HKEY_CURRENT_USER\Software\Classes
  2. If a key "*" is present under software\Classes skip the next step 
  3. Right click on Classes and choose "New->Key". Name the new key "*"
  4. If a key "shell"  is present under Software\Classes\*  skip the next step 
  5. Right click on "*" and choose "New->Key". Name the new key "shell"
  6. Right-click on shell and choose "New->Key". Name the new key "Edit with Notepad++" (without quotes)
  7. Right-click on  "Edit with Notepad++" and choose "New->Key". Name the key as "command"
  8. Now select "command" and navigate to the right pane
  9. Double click "Default" in the right pane 
  10. Enter a value "C:\MyBin\Notepad++\Notepad++.exe "%1"" (without the outer quotes)
The context menu should appear in Windows Explorer for files of all types

2 comments:

  1. you forgot "command" Key between shell and Notepad

    ReplyDelete
  2. and Inside the Key "Edit with Notepad++" you can create a new String called Icon and point to your notepad++.exe

    ReplyDelete