Skip to content

Instantly share code, notes, and snippets.

@higstar
Forked from arieljannai/pycharm.bat
Last active October 26, 2017 06:10
Show Gist options
  • Save higstar/93b74522beb0e7597c70dab442ebf2cf to your computer and use it in GitHub Desktop.
Save higstar/93b74522beb0e7597c70dab442ebf2cf to your computer and use it in GitHub Desktop.
Add PyCharm to context menu (right click menu)
@echo off
@rem throw this file in jetbrains installation folder, it takes the last created PyCharm folder (the latest ide update) for the script
SET JetBrainsPath=C:\Program Files\JetBrains
FOR /F "delims=" %%i IN ('dir /b /ad-h /t:c /od -filter "%JetBrainsPath%\PyCharm*"') DO SET a=%%i
SET PyCharmPath=%JetBrainsPath%\%a%\bin\PyCharm64.exe
echo %PyCharmPath%
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PyCharm" /t REG_SZ /v "" /d "Open in &PyCharm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PyCharm" /t REG_EXPAND_SZ /v "Icon" /d "%PyCharmPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PyCharm\command" /t REG_SZ /v "" /d "%PyCharmPath% \"%%1\"" /f
echo Adding folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in PyCharm" /t REG_SZ /v "" /d "Open directory in &PyCharm" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in PyCharm" /t REG_EXPAND_SZ /v "Icon" /d "%PyCharmPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in PyCharm\command" /t REG_SZ /v "" /d "%PyCharmPath% \"%%1\"" /f
echo Adding folder background entries
@reg add "HKEY_CLASSES_ROOT\Directory\background\shell\Open directory in PyCharm" /t REG_SZ /v "" /d "Open directory in &PyCharm" /f
@reg add "HKEY_CLASSES_ROOT\Directory\background\shell\Open directory in PyCharm" /t REG_EXPAND_SZ /v "Icon" /d "%PyCharmPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\background\shell\Open directory in PyCharm\command" /t REG_SZ /v "" /d "%PyCharmPath% \"%%V\"" /f
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment