Contents

Windows 10: Add entries to desktop context menu

Caution
Editing the registry incorrectly may crash your system - you have been warned!

Add Mozilla Firefox to desktop context menu

  • Open registry editor via regedit.exe.
  • Open key Computer\HKEY_CLASSES_ROOT\Directory\Background\shell.
  • Add key name Firefox via right-click on shell.
  • Add key name command beneath key Firefox.
  • Click on key command, double click on REG_SZ string (Standard) or (Default) depending on your localization.
  • Add path to firefox.exe (on my system "C:\Program Files\Mozilla Firefox\firefox.exe").
  • Now, when you right click on your desktop, there will be an entry Firefox which will start Firefox.

Add an icon to Firefox desktop menu entry

  • Open registry editor via regedit.exe.
  • Open key Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\Firefox.
  • Add REG_SZ string via right-click and name it Icon.
  • Double click the new string and set it to your firefox.exe (on my system "C:\Program Files\Mozilla Firefox\firefox.exe").
  • When everything is correct, you will have the Firefox icon next to your Firefox desktop context menu entry.

Set position of desktop context menu entries

  • You can set the position of your desktop context menu entries to top or to bottom.
  • To set the position of the Firefox desktop context menu entry to top, open the registry editor via regedit.exe, open key Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\Firefox, add a REG_SZ string and name it Position.
  • To set the position of your desktop menu entry to top, set its value to Top.
  • To set the position of your desktop menu entry to bottom, set its value to Bottom.
  • Notice that Windows desktop context menu entries maycause your icons to appear near the top or the bottom, not exactly at the top or the bottom.

Add separators between desktop context menu entries

  • You can add a separator before or after your desktop context menu entries.
  • To add a separator before your desktop context menu entry, open the registry editor via regedit.exe, open the key Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\Firefox and add a new REG_SZ string named SeparatorBefore. Leave its value empty.
  • To add a separator after your desktop context menu entry, open the registry editor via regedit.exe, open the key Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\Firefox and add a new REG_SZ string named SeparatorAfter. Leave its value empty.

Open folders from desktop context menu

  • To add folder to the desktop context menu, open registry editor via regedit.exe and add the folder name as new key under Computer\HKEY_CLASSES_ROOT\Directory\Background\shell.
  • Add a new key under the folder name key and name it command.
  • Select the new command key and set the value of its (Standard) or (Default) REG_SZ string to "C:\Windows\explorer.exe" "%YOUR_FOLDER_PATH%" (replace %YOUR_FOLDER_PATH% with your full folder path).
  • To add the folder icon to your context menu entry, choose your folder key (the key above the command key), add a REG_SZ string and name it Icon.
  • Set the value of REG_SZ string Icon to "C:\Windows\explorer.exe".

Starting an application as administrator from a desktop context menu entry

  • To start a process as administrator, start it through PowerShell:
  • To start Visual Studio 2019 as administrator, add keys as described above and set its command to "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -command "&{start-process 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe' -verb RunAs}".
  • To load a solution as administrator directly, put it in the command like in "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -command "&{start-process 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe' '%PATH_TO_PROJECT.sln%' -verb RunAs}".