Last active
June 22, 2021 17:04
-
-
Save amnuts/162f6b03c5f94692fd6c to your computer and use it in GitHub Desktop.
Add context menu to Windows 7 to open file/folder in PhpStorm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
SET PhpStormPath=C:\Program Files (x86)\JetBrains\PhpStorm 8.0.2\bin\PhpStorm64.exe | |
echo Adding file entries | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f | |
echo Adding folder entries | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in PhpStorm" /t REG_SZ /v "" /d "Open directory in PhpStorm" /f | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f | |
pause |
Here is the one that works perfectly for me
- Create a file name it webstorm.bat
- Open file in any text editor
- Copy all text below from
@echo off
topause
and paste it in the file - Consider replace the
<Webstorm.exe path>
with yourwebstorm.exe
path
for e.g
C:\Program Files\JetBrains\WebStorm 2017.2.2\bin\webstorm64.exe
- Save changes to the file
- Right click on the file then Run as Administrator
- Enjoy it!
@echo off
SET WebStormPath=<Webstorm.exe path>
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_SZ /v "" /d "Open w&ith WebStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WebStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm\command" /t REG_SZ /v "" /d "%WebStormPath% \"%%1\"" /f
echo Adding folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /t REG_SZ /v "" /d "Open w&ith WebStorm" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WebStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\WebStorm\command" /t REG_SZ /v "" /d "%WebStormPath% \"%%1\"" /f
echo Adding folder backgrounds
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\WebStorm" /t REG_SZ /v "" /d "Open w&ith WebStorm" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WebStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\WebStorm\command" /t REG_SZ /v "" /d "%WebStormPath% \"%%V\"" /f
pause
Works in Windows 10 as well ! Thank you very much :)
Here's a better version for PhpStorm:
@echo off
SET PhpStormPath=D:\Programs\JetBrains\PhpStorm 2018.1.6\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
You can either click on a file, folder or if you're inside a folder - on empty space and open it in PhpStorm. It isn't mine, I just tweaked this gist that was intended for WebStorm
@FawzyMokhtar thanks, worked nicely on Windows 10. (Just replaced the string "WebStorm" with "PHPStorm", similar to what KulaGGin did)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works great ! ❤️