Skip to content

Instantly share code, notes, and snippets.

@mac2000
Forked from amnuts/phpstorm.bat
Last active September 1, 2020 18:46
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mac2000/cd3560b98ca5e23abe9f3166e40d2ed2 to your computer and use it in GitHub Desktop.
Save mac2000/cd3560b98ca5e23abe9f3166e40d2ed2 to your computer and use it in GitHub Desktop.
Open with WebStorm context menu
@ECHO OFF
REM Remove registry if any
REG DELETE "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /f
REM Get WebStorm executable path
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_CLASSES_ROOT\Applications\WebStorm.exe\shell\open\command"`) DO (
SET WEBSTORM=%%A %%B
)
REM Remove ' "%1"' from it
SET WEBSTORM=%WEBSTORM:~0,-5%
REM Add registry keys
REG ADD "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /t REG_SZ /v "" /d "Open directory in WebStorm" /f
REG ADD "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WEBSTORM%,0" /f
REG ADD "HKEY_CLASSES_ROOT\Directory\shell\WebStorm\command" /t REG_SZ /v "" /d "%WEBSTORM% \"%%1\"" /f
PAUSE
@etiennejcharles
Copy link

Amazing, really thanks for that, that should be enabled by default via Webstorm.

@vijaychaudhari88
Copy link

Thank you.

@pblanton
Copy link

Noice. Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment