Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add Open Folder in PHPStorm to Windows Context Menu
@echo off
SET PhpStormPath=C:\Program Files\JetBrains\PhpStorm 2020.3.3\bin\phpstorm64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f
echo Adding within a folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\PhpStorm" /t REG_SZ /v "" /d "Open with PhpStorm" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%V\"" /f
echo Adding folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\shell\PhpStorm" /t REG_SZ /v "" /d "Open with PhpStorm" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f
@ibrahimhajjaj

This comment has been minimized.

Copy link
Owner Author

@ibrahimhajjaj ibrahimhajjaj commented Aug 28, 2020

Make sure to change PhpStormPath to match your current path.

@jpmmartins

This comment has been minimized.

Copy link

@jpmmartins jpmmartins commented Sep 17, 2020

Nice... Remember you need to run this as administrator in order for it to work. I had to put a pause at the end of the script to see that nothing was being changed.

@sshkpp

This comment has been minimized.

Copy link

@sshkpp sshkpp commented Feb 28, 2021

SET PhpStormPath=C:\Program Files\JetBrains\PhpStorm 2020.2.1\bin\phpstorm64.exe

Caution! Check your directory.

It works!

@smartsites-dev-n01

This comment has been minimized.

Copy link

@smartsites-dev-n01 smartsites-dev-n01 commented Mar 22, 2021

It works!

@karrarjasim

This comment has been minimized.

Copy link

@karrarjasim karrarjasim commented Apr 10, 2021

thanks!

@WaLkZa

This comment has been minimized.

Copy link

@WaLkZa WaLkZa commented Apr 28, 2021

Thanks.
image

@anatol06

This comment has been minimized.

Copy link

@anatol06 anatol06 commented Jun 29, 2021

This method worked in Windows 10. In Windows 11 Phpstorm disappeared from the right click menu and setting it again with this method does not change anything :(

@ibrahimhajjaj

This comment has been minimized.

Copy link
Owner Author

@ibrahimhajjaj ibrahimhajjaj commented Jun 29, 2021

This method worked in Windows 10. In Windows 11 Phpstorm disappeared from the right click menu and setting it again with this method
does not change anything :(

It still works just fine ✔️ , but you have to right-click on the folder from the outside.

image

@anatol06

This comment has been minimized.

Copy link

@anatol06 anatol06 commented Jun 29, 2021

O! Thank you! Now I see, it works!

@noamzilo

This comment has been minimized.

Copy link

@noamzilo noamzilo commented Nov 7, 2021

Works when run as administrator!

Pycharm code for you lazies out there

@echo off

SET StormPath=C:\Program Files\JetBrains\PyCharm 2021.2.3\bin\pycharm64.exe
 
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\PyCharm" /t REG_SZ /v "" /d "Open in PyCharm"   /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PyCharm" /t REG_EXPAND_SZ /v "Icon" /d "%StormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PyCharm\command" /t REG_SZ /v "" /d "%StormPath% \"%%1\"" /f
 
echo Adding within a folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\PyCharm" /t REG_SZ /v "" /d "Open with PyCharm"   /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\PyCharm" /t REG_EXPAND_SZ /v "Icon" /d "%StormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\PyCharm\command" /t REG_SZ /v "" /d "%StormPath% \"%%V\"" /f

echo Adding folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\shell\PyCharm" /t REG_SZ /v "" /d "Open with PyCharm"   /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\PyCharm" /t REG_EXPAND_SZ /v "Icon" /d "%StormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\PyCharm\command" /t REG_SZ /v "" /d "%StormPath% \"%%1\"" /f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment