Skip to content

Instantly share code, notes, and snippets.

@rqx110
Forked from arieljannai/pycharm.bat
Created August 13, 2019 00:37
Show Gist options
  • Save rqx110/23f1a4661ce7e7f7f181a5566b5cd27c to your computer and use it in GitHub Desktop.
Save rqx110/23f1a4661ce7e7f7f181a5566b5cd27c 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
FOR /F "delims=" %%i IN ('dir /b /ad-h /t:c /od -filter "PyCharm*"') DO SET a=%%i
SET PyCharmPath=C:\Program Files (x86)\JetBrains\%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