79 words
1 minute
How to add git bash to Windows context menu
1@echo off2:: Check admin3net session >nul 2>&14if %errorLevel% == 0 (5 echo Running as admin6) else (7 echo Requesting for admin8 powershell -Command "Start-Process '%~f0' -Verb runAs"9 exit /b10)11
12
13set "key=HKEY_CLASSES_ROOT\Directory\Background\shell\Git Bash Here"14set "icon=C:\Program Files\Git\mingw64\share\git\git-for-windows.ico"15set "command=C:\Program Files\Git\bin\bash.exe --login -i"16
17reg add "%key%" /ve /d "Git Bash Here" /f18reg add "%key%" /v "Icon" /d "%icon%" /f19reg add "%key%\command" /ve /d "%command%" /f20
21echo Git Bash Here context menu added successfully.22pause How to add git bash to Windows context menu
/posts/tutorial-git/addtocontextmenu/ Some information may be outdated