如何添加系统右键菜单? 我把我的全收集在这里!
Reference: https://www.zhihu.com/question/48091139
How to
Save the code below as foobar.reg and execute it.
Notice ! Modify path !
- Modify the path to your path! For instance:
C:\\Users\\foobar\\scoop\\apps\\git\\current\\git-bash.exeto\\you\\dope\\path\\sth.exe. - Save the content as
.regfile and execute it as administrator.
Install and Uninstall Context
Sublime-text
Install:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with &Sublime]
@="Open with &Sublime"
"Icon"="C:\\Users\\Notebook\\scoop\\apps\\sublime-text\\3211\\sublime_text.exe"
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with &Sublime\command]
@="\"C:\\Users\\Notebook\\scoop\\apps\\sublime-text\\3211\\sublime_text.exe\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with &Sublime]
@="Open with &Sublime"
"Icon"="C:\\Users\\Notebook\\scoop\\apps\\sublime-text\\3211\\sublime_text.exe"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with &Sublime\command]
@="\"C:\\Users\\Notebook\\scoop\\apps\\sublime-text\\3211\\sublime_text.exe\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with &Sublime]
@="Open with &Sublime"
"Icon"="C:\\Users\\Notebook\\scoop\\apps\\sublime-text\\3211\\sublime_text.exe"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with &Sublime\command]
@="\"C:\\Users\\Notebook\\scoop\\apps\\sublime-text\\3211\\sublime_text.exe\" \"%V\""
Uninstall:
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\*\shell\Open with &Sublime]
[-HKEY_CURRENT_USER\Software\Classes\*\shell\Open with &Sublime\command]
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with &Sublime]
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with &Sublime\command]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with &Sublime]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with &Sublime\command]
emacs
Install:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with emacs]
@="Open with emacs"
"Icon"="C:\\Users\\foobar\\scoop\\apps\\emacs\\current\\bin\\runemacs.exe"
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with emacs\command]
@="\"C:\\Users\\foobar\\scoop\\apps\\emacs\\current\\bin\\runemacs.exe\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with emacs]
@="Open with emacs"
"Icon"="C:\\Users\\foobar\\scoop\\apps\\emacs\\current\\bin\\runemacs.exe"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with emacs\command]
@="\"C:\\Users\\foobar\\scoop\\apps\\emacs\\current\\bin\\runemacs.exe\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with emacs]
@="Open with emacs"
"Icon"="C:\\Users\\foobar\\scoop\\apps\\emacs\\current\\bin\\runemacs.exe"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with emacs\command]
@="\"C:\\Users\\foobar\\scoop\\apps\\emacs\\current\\bin\\runemacs.exe\" \"%V\""
Uninstall:
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\*\shell\Open with emacs]
[-HKEY_CURRENT_USER\Software\Classes\*\shell\Open with emacs\command]
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with emacs]
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with emacs\command]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with emacs]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with emacs\command]
Vim
Install:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\nvim]
@="Open With NVIM"
"Icon"="C:\\Users\\Notebook\\scoop\\apps\\neovim\\current\\bin\\nvim-qt.exe"
[HKEY_CLASSES_ROOT\*\shell\nvim\command]
@="\"C:\\Users\\Notebook\\scoop\\apps\\neovim\\current\\bin\\nvim-qt.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\nvim]
@="Open With NVIM"
"Icon"="C:\\Users\\Notebook\\scoop\\apps\\neovim\\current\\bin\\nvim-qt.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\nvim\command]
@="\"C:\\Users\\Notebook\\scoop\\apps\\neovim\\current\\bin\\nvim-qt.exe\" \"%V\""
[HKEY_CLASSES_ROOT\Directory\shell\nvim]
@="Open With NVIM"
"Icon"="C:\\Users\\Notebook\\scoop\\apps\\neovim\\current\\bin\\nvim-qt.exe"
[HKEY_CLASSES_ROOT\Directory\shell\nvim\command]
@="\"C:\\Users\\Notebook\\scoop\\apps\\neovim\\current\\bin\\nvim-qt.exe\" \"%1\""
Unistall:
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\*\shell\Open with NVIM]
[-HKEY_CURRENT_USER\Software\Classes\*\shell\Open with NVIM\command]
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with NVIM]
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with NVIM\command]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with NVIM]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with NVIM\command]
Git bash
Inistall:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\git_shell]
@="Git Ba&sh Here"
"Icon"="C:\\Users\\Notebook\\scoop\\apps\\git\\current\\git-bash.exe"
[HKEY_CLASSES_ROOT\Directory\shell\git_shell\command]
@="\"C:\\Users\\Notebook\\scoop\\apps\\git\\current\\git-bash.exe\" \"--cd=%1\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\git_shell]
@="Git Ba&sh Here"
"Icon"="C:\\Users\\Notebook\\scoop\\apps\\git\\current\\git-bash.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\git_shell\command]
@="\"C:\\Users\\Notebook\\scoop\\apps\\git\\current\\git-bash.exe\" \"--cd=%v.\""
Unistall:
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\*\shell\git_bash]
[-HKEY_CURRENT_USER\Software\Classes\*\shell\git_bash\command]
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\git_bash]
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\git_bash\command]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\git_bash]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\git_bash\command]
Difference
Method 1 you need to edit via regedit to change the value to your git-bash path.
Method 2 you just edit here and run it.
EOF