Skip to content

Instantly share code, notes, and snippets.

@daretodave
Created February 4, 2019 23:34
Show Gist options
  • Save daretodave/d39e4a10a58245c1b54b0c7bd2f20152 to your computer and use it in GitHub Desktop.
Save daretodave/d39e4a10a58245c1b54b0c7bd2f20152 to your computer and use it in GitHub Desktop.
Add WebStorm to right click context menu on windows. Save as a "ps1", run as admin.
$BIN = ("C:\Program Files\Jetbrains","$env:LOCALAPPDATA\Jetbrains")
$TOOL = Get-Childitem `
-Recurse `
–Path $BIN `
-Filter webstorm64.exe `
| Select-Object -first 1 `
| %{$_.FullName}
if (!$TOOL) {
Write-Output "This script could not find webstorm "
return 0
}
Write-Output "Found WS | $TOOL"
Write-Output "right click on files...."
reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_SZ /d "Open with WebStorm" /f
reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "$TOOL,0" /f
reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm\command" /t REG_SZ /d "$TOOL" /f
Write-Output "right click in folder...."
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\WebStorm" /t REG_SZ /d "Open with WebStorm" /f
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "$TOOL,0" /f
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\WebStorm\command" /t REG_SZ /d "$TOOL" /f
Write-Output "right click on folder...."
reg add "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /t REG_SZ /d "Open with WebStorm" /f
reg add "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "$TOOL,0" /f
reg add "HKEY_CLASSES_ROOT\Directory\shell\WebStorm\command" /t REG_SZ /d "$TOOL" /f
Write-Output "done!"
return 0
@daretodave
Copy link
Author

For my future self, here's a one-liner for powershell:

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://gist.githubusercontent.com/daretodave/d39e4a10a58245c1b54b0c7bd2f20152/raw/7549c36f0f03c8970240d042e170b5a1467f6f2c/ws-right-click.ps1'))

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