Blog

How to add "Open [program] Here" on Windows context menu

How to add "Open [program] Here" on Windows context menu
13 Jan 2019 | General | 0

How to add "Open [program] Here" on Windows context menu

I am going to use PhpStorm by JetBrains to demonstrate how to add "Open PhpStorm Here" on Windows context menu. This will allow you to open the program and start editing your code on a given directory. PhpStorm does not have an option during installation and normally you have to launch the program first, then browse to a specific directory.

Alternatively, you can use create a new registry file (somename.reg) and paste the following code. You can replace the paths to reflect whichever program you would like to add.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\PhpStorm]
@="Open PhpStorm Here"
"icon"="C:\\Program Files\\JetBrains\\PhpStorm 2018.2.5\\bin\\phpstorm64.exe"

[HKEY_CLASSES_ROOT\Directory\shell\PhpStorm\command]
@="\"C:\\Program Files\\JetBrains\\PhpStorm 2018.2.5\\bin\\phpstorm64.exe\" \"%V\""

Not that the "icon" path is the same as the program's executable file. You can use any other .exe file that has an icon you wish to displayed.

Bonus

Add "Open with [program]" to the context menu

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\PhpStorm]
@="Open W&th PhpStorm"
"icon"="C:\\Program Files\\JetBrains\\PhpStorm 2018.2.5\\bin\\phpstorm64.exe"

[HKEY_CLASSES_ROOT\*\shell\PhpStorm\command]
@="\"C:\\Program Files\\JetBrains\\PhpStorm 2018.2.5\\bin\\phpstorm64.exe\" \"%1\""

Discussion