Short of re-installing git or editing the relevant registry key that adds context menus to the shell myself, I was wondering if there was another way to bring back the "Git Bash Here" and "Open command window here" menus?
I am using Windows 7 Home Premium 64-bit.
Checkout this SO question:
Context menu for right click on folders in left panel of Windows
Explorer or on background of a directory in right panel:
- HKEY_CLASSES_ROOT\\Directory\\Background\\shell if you are administrator
- HKEY_CURRENT_USER\\Software\\Classes\\directory\\Background\\shell if you are a normal user
Context menu for right click on folders in right panel of Windows
Explorer:
- HKEY_CLASSES_ROOT\\Directory\\shell if you are administrator
- HKEY_CURRENT_USER\\Software\\Classes\\directory\\shell if you are a normal user
Context menu for any file:
- HKEY_CLASSES_ROOT\\*\\shell if you are administrator
- HKEY_CURRENT_USER\\Software\\Classes\\*\\shell if you are a normal user
In all cases:
- add a new key under "shell", naming it as you want to name the context menu item
- add a new key inside this key, named command (mandatory name)
- edit the "default" property in "command" to myprogrampath\\path\\path\\executable.exe %1 to pass the file path and name of the selected file to your custom program
Update:
So I did a little more research into where the actual git bash and git gui context menu items were stored in the registry. I exported the keys that I had in my registry into a .reg
file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_shell\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_gui\command]
@="\"C:\\Program Files\\Git\\cmd\\git-gui.exe\" \"--working-dir\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\git_shell\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%v.\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\git_gui\command]
@="\"C:\\Program Files\\Git\\cmd\\git-gui.exe\" \"--working-dir\" \"%v.\""
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.