Skip to content

Instantly share code, notes, and snippets.

@m93a
Last active December 26, 2023 05:43
Show Gist options
  • Save m93a/7a035e202ba2f5d0a73b07a5643c89df to your computer and use it in GitHub Desktop.
Save m93a/7a035e202ba2f5d0a73b07a5643c89df to your computer and use it in GitHub Desktop.
Create neat sub-menus for Windows Explorer directory right-click, one for the Command Line, one for PowerShell and one for Git
Windows Registry Editor Version 5.00
; GitHub Desktop
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuGit\shell\github]
; "Icon"=(REG_EXPAND_SZ)"%LocalAppData%\\GitHubDesktop\\GitHubDesktop.exe"
"Icon"=hex(2):25,00,4c,00,6f,00,63,00,61,00,6c,00,41,00,70,00,70,00,44,00,61,\
00,74,00,61,00,25,00,5c,00,47,00,69,00,74,00,48,00,75,00,62,00,44,00,65,00,\
73,00,6b,00,74,00,6f,00,70,00,5c,00,47,00,69,00,74,00,48,00,75,00,62,00,44,\
00,65,00,73,00,6b,00,74,00,6f,00,70,00,2e,00,65,00,78,00,65,00,00,00
"MUIVerb"="GitHub"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuGit\shell\github\command]
; @=(REG_EXPAND_SZ)"\"%LocalAppData%\\GitHubDesktop\\bin\\github.bat\" \"%v\""
@=hex(2):22,00,25,00,4c,00,6f,00,63,00,61,00,6c,00,41,00,70,00,70,00,44,00,61,\
00,74,00,61,00,25,00,5c,00,47,00,69,00,74,00,48,00,75,00,62,00,44,00,65,00,\
73,00,6b,00,74,00,6f,00,70,00,5c,00,62,00,69,00,6e,00,5c,00,67,00,69,00,74,\
00,68,00,75,00,62,00,2e,00,62,00,61,00,74,00,22,00,20,00,22,00,25,00,76,00,\
22,00,00,00
Windows Registry Editor Version 5.00
; Command Prompt
[HKEY_CLASSES_ROOT\Directory\shell\01MenuCmd]
"MUIVerb"="Command Prompts"
"Icon"="cmd.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuCmd"
[HKEY_CLASSES_ROOT\Directory\background\shell\01MenuCmd]
"MUIVerb"="Command Prompts"
"Icon"="cmd.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuCmd"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\open]
"MUIVerb"="Command Prompt"
"Icon"="cmd.exe"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\open\command]
@="cmd.exe /s /k pushd \"%V\""
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas]
"MUIVerb"="Command Prompt Elevated"
"Icon"="cmd.exe"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
; PowerShell
[HKEY_CLASSES_ROOT\Directory\shell\02MenuPowerShell]
"MUIVerb"="PowerShell Prompts"
"Icon"="powershell.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuPowerShell"
[HKEY_CLASSES_ROOT\Directory\background\shell\02MenuPowerShell]
"MUIVerb"="PowerShell Prompts"
"Icon"="powershell.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuPowerShell"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open]
"MUIVerb"="PowerShell"
"Icon"="powershell.exe"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open\command]
@="powershell.exe -noexit -command Set-Location '%V'"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas]
"MUIVerb"="PowerShell Elevated"
"Icon"="powershell.exe"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas\command]
@="powershell.exe -noexit -command Set-Location '%V'"
; Ensure OS Entries are on the Extended Menu (Shift-Right Click)
[HKEY_CLASSES_ROOT\Directory\shell\cmd]
"Extended"=""
[HKEY_CLASSES_ROOT\Directory\background\shell\cmd]
"Extended"=""
[HKEY_CLASSES_ROOT\Directory\shell\Powershell]
"Extended"=""
[HKEY_CLASSES_ROOT\Directory\background\shell\Powershell]
"Extended"=""
; GIT
[HKEY_CLASSES_ROOT\Directory\shell\03MenuGit]
"MUIVerb"="GIT Prompts"
"Icon"="C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuGit"
[HKEY_CLASSES_ROOT\Directory\background\shell\03MenuGit]
"MUIVerb"="GIT Prompts"
"Icon"="C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuGit"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuGit\shell\git_gui]
"MUIVerb"="Git GUI"
"Icon"="C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuGit\shell\git_gui\command]
@="\"C:\\Program Files\\Git\\cmd\\git-gui.exe\" \"--working-dir\" \"%v.\""
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuGit\shell\git_shell]
"MUIVerb"="Git Bash"
"Icon"="C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuGit\shell\git_shell\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%v.\""
; Remove Official GIT Entries
[-HKEY_CLASSES_ROOT\Directory\shell\git_gui]
[-HKEY_CLASSES_ROOT\Directory\background\shell\git_gui]
[-HKEY_CLASSES_ROOT\Directory\shell\git_shell]
[-HKEY_CLASSES_ROOT\Directory\background\shell\git_shell]
@nkmathew
Copy link

nkmathew commented Apr 3, 2020

Impressive

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