Skip to content

Instantly share code, notes, and snippets.

@rwatts3
Forked from amnuts/phpstorm.bat
Last active April 4, 2023 07:53
Show Gist options
  • Save rwatts3/26b58cfb27df1db1aabdbcce16848437 to your computer and use it in GitHub Desktop.
Save rwatts3/26b58cfb27df1db1aabdbcce16848437 to your computer and use it in GitHub Desktop.
Add context menu to Windows 7 to open file/folder in Intellij Idea
@echo off
SET IntellijPath=C:\Program Files\JetBrains\IntelliJ IDEA 173.2463.16\bin\idea64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in Intellij" /t REG_SZ /v "" /d "Open in Intellij" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in Intellij" /t REG_EXPAND_SZ /v "Icon" /d "%IntellijPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in Intellij\command" /t REG_SZ /v "" /d "%IntellijPath% \"%%1\"" /f
echo Adding folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in Intellij" /t REG_SZ /v "" /d "Open directory in Intellij" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in Intellij" /t REG_EXPAND_SZ /v "Icon" /d "%IntellijPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in Intellij\command" /t REG_SZ /v "" /d "%IntellijPath% \"%%1\"" /f
echo Adding folder background entries
@reg add "HKEY_CLASSES_ROOT\Directory\Background\Open directory in Intellij" /t REG_SZ /v "" /d "Open directory in Intellij" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\Open directory in Intellij" /t REG_EXPAND_SZ /v "Icon" /d "%IntellijPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\Open directory in Intellij\command" /t REG_SZ /v "" /d "%IntellijPath% "%%1"" /f
pause
REM @echo off
REM SET IntellijPath=C:\Program Files\JetBrains\IntelliJ IDEA 173.2463.16\bin\idea64.exe
REM echo removing file entries
REM @reg remove "HKEY_CLASSES_ROOT\*\shell\Open in Intellij" /t REG_SZ /v "" /d "Open in Intellij" /f
REM @reg remove "HKEY_CLASSES_ROOT\*\shell\Open in Intellij" /t REG_EXPAND_SZ /v "Icon" /d "%IntellijPath%,0" /f
REM @reg remove "HKEY_CLASSES_ROOT\*\shell\Open in Intellij\command" /t REG_SZ /v "" /d "%IntellijPath% \"%%1\"" /f
REM echo removing folder entries
REM @reg remove "HKEY_CLASSES_ROOT\Directory\shell\Open directory in Intellij" /t REG_SZ /v "" /d "Open directory in Intellij" /f
REM @reg remove "HKEY_CLASSES_ROOT\Directory\shell\Open directory in Intellij" /t REG_EXPAND_SZ /v "Icon" /d "%IntellijPath%,0" /f
REM @reg remove "HKEY_CLASSES_ROOT\Directory\shell\Open directory in Intellij\command" /t REG_SZ /v "" /d "%IntellijPath% \"%%1\"" /f
REM echo removing folder background entries
REM @reg remove "HKEY_CLASSES_ROOT\Directory\Background\Open directory in Intellij" /t REG_SZ /v "" /d "Open directory in Intellij" /f
REM @reg remove "HKEY_CLASSES_ROOT\Directory\Background\Open directory in Intellij" /t REG_EXPAND_SZ /v "Icon" /d "%IntellijPath%,0" /f
REM @reg remove "HKEY_CLASSES_ROOT\Directory\Background\Open directory in Intellij\command" /t REG_SZ /v "" /d "%IntellijPath% "%%1"" /f
REM pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment