79 words
1 minute
How to add git bash to Windows context menu
2021-12-02
统计加载中...
Terminal window
@echo off
:: Check admin
net session >nul 2>&1
if %errorLevel% == 0 (
echo Running as admin
) else (
echo Requesting for admin
powershell -Command "Start-Process '%~f0' -Verb runAs"
exit /b
)
set "key=HKEY_CLASSES_ROOT\Directory\Background\shell\Git Bash Here"
set "icon=C:\Program Files\Git\mingw64\share\git\git-for-windows.ico"
set "command=C:\Program Files\Git\bin\bash.exe --login -i"
reg add "%key%" /ve /d "Git Bash Here" /f
reg add "%key%" /v "Icon" /d "%icon%" /f
reg add "%key%\command" /ve /d "%command%" /f
echo Git Bash Here context menu added successfully.
pause
How to add git bash to Windows context menu
https://blog.spr-aachen.com/posts/tutorial-git/addtocontextmenu/
Author
Spr-Aachen
Published at
2021-12-02
License
CC BY-NC-SA 4.0

Some information may be outdated

封面
Music
Artist
封面
Music
Artist
0:00 / 0:00