views:

220

answers:

5

Under Windows 7 I'd like to change the settings for the Git Bash Here shell extension command window, e.g. width, height and font. But when I do this, I get an error "Unable to modify the shortcut".

I can modify the shortcut for Git Bash in the Start menu by using "Run as administrator..." This works, but only for Bash windows opened from the Start menu. It doesn't work for the "Git Bash Here" shell extension and there's no "Run as administrator..." option on right-click context menu.

How do you do it?

A: 

You could try freewares like Default Programs Editor or Context Menu Editor, and see if that allows you:

  • to edit properly the shortcut,
  • or to define a new shortcut (which behaves like you want) and register that shortcut in the contextual menu.
VonC
Thanks, but surely there's a way to do this without installing 3rd party software?!?!I know it's possible because my colleague has done it, but can't remember how!!! :-))
netgirlk
A: 

You can edit the shell's context menu handlers directly in the Windows Registry. The one you're looking for is probably under one of these branches:

  • HKCR\Directory\Shell\
  • HKCR\Directory\ShellEx\ContextMenuHandlers\
  • HKCR\Folder\Shell\
  • HKCR\Folder\ShellEx\ContextMenuHandlers\
  • HKCR\AllFilesystemObjects\shell\
  • HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\

Here is a lengthy article explaining what you can do there. See the second half of this article for more tips on where to look.

ewall
A: 

try going to C:\Program Files (x86)\Git or wherever you installed git and edit the git bash shortcut, the size is in the layout tab

leegeorg07
A: 

If you run git bash as administrator by right clicking on its icon and selecting "Run As Administrator" you will be able to change your settings and have them persist.

You can verify this by closing the admin session then reopening as a normal user.

I did this to set the defaults then just used git as a normal user from then on.

sparks
this worked but i had to run the Bash Shortcut icon as administrator once and it persisted the settings.
netgirlk
A: 

You can modify the settings applied when using the Git Bash Here context menu by doing the following:

  1. Open the Git for Windows installation folder. e.g. C:\Program Files (x86)\Git.
  2. Right click on the Git Bash shortcut file and select Run As Administrator.
  3. Click Yes if asked whether you want to give the Windows Command Processor permissions to modify the computer (otherwise your changes will not be persisted).
  4. Modify the properties as you wish (right click title bar and click properties) and then close the window.

This works because clicking the Git Bash Here shell extension menu item runs the command wscript "C:\Program Files (x86)\Git\Git Bash.vbs" "%1". This is specified in the registry key HKEY_CLASSES_ROOT\Directory\shell\git_shell\command. This vbs file sets the current directory and then executes the Git Bash shortcut. Once you have changed the settings on this shortcut, they will always be used when this shortcut is run (regardless of being admin or not).

bentayloruk