-
-
Save M1chaelTran/f22ac7c48466e8970f932ab743043e79 to your computer and use it in GitHub Desktop.
@echo off | |
:: change the path below to match your installed version | |
SET WebStormPath=C:\Program Files\JetBrains\WebStorm 2017.2.2\bin\webstorm64.exe | |
echo Adding file entries | |
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_SZ /v "" /d "Open with WebStorm" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WebStormPath%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm\command" /t REG_SZ /v "" /d "%WebStormPath% \"%%1\"" /f | |
echo Adding within a folder entries | |
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\WebStorm" /t REG_SZ /v "" /d "Open with WebStorm" /f | |
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WebStormPath%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\WebStorm\command" /t REG_SZ /v "" /d "%WebStormPath% \"%%V\"" /f | |
echo Adding folder entries | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /t REG_SZ /v "" /d "Open with WebStorm" /f | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WebStormPath%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\WebStorm\command" /t REG_SZ /v "" /d "%WebStormPath% \"%%1\"" /f | |
pause |
All good I went to sleep after that. That's is quite odd, this seems to be the fragment that is failing, so you can try running that
foreach ($item in (Get-ChildItem (Join-Path $env:LOCALAPPDATA "JetBrains\Toolbox\apps") -Exclude Toolbox)) {
Get-ChildItem -Path (Join-Path $item.FullName "ch-0") -Directory -Exclude "*.plugins"
}
it seems like the full name property is missing so maybe try just printing that
foreach ($item in (Get-ChildItem (Join-Path $env:LOCALAPPDATA "JetBrains\Toolbox\apps") -Exclude Toolbox)) {
$item.FullName
}
Thank You for the help
Ok, so I think I figured out what's happening or at least will be able to tell now. Basically, PowerShell was being stupid and giving an almost useless error message. It will now give the proper error message, but I think it's failing to find the version / correct version folder.
Try downloading and running the latest version of the script, I also added some verbose logging so give .\toolbox-context-menu.ps1 -List -Verbose
a try. To be clear it still has the same issue but just has the ability to tell me whats actually wrong.
Sorry for not replying to @Townsy45 for so long.
Just an update for anyone following the problem identified above, it has now been fixed and the script has been updated.
It's probably best to keep discussion of issues related to my PowerShell script over on its own gist.
If you only need to add a right-click menu to the file, you can use a simple registry to replace the installation path with your own, paying attention to path escaping.
Create a WebStorm.reg
file, copy the code, and double-click to run it.
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\WebStorm]
@="Open with WebStorm"
"Icon"="C:\\Program Files\\JetBrains\\WebStorm 2022.1\\bin\\webstorm64.exe,0"
[HKEY_CLASSES_ROOT\*\shell\WebStorm\command]
@="\"C:\\Program Files\\JetBrains\\WebStorm 2022.1\\bin\\webstorm64.exe\" \"%1\""
Thank you very much!)))))
Greatly appreciate it!
Спасибо! Thank u
thank you very much, still working!
tried on windows 10
Thank you, still works at windows 11!
Still works win11 Pro
I use this dirty hack to get the latest installed version of PHPStorm in "Program Files" (instead of giving the exact version in the script) :
set "PhpStormPath="
for /d %%A in ("C:\Program Files\JetBrains\PhpStorm*") do (
set "PhpStormPath=%%~fA"
)
This is something that was incorporated in the core of the Intellej familty of products so I don't think this thread is relevant any longer
I use this dirty hack to get the latest installed version of PHPStorm in "Program Files" (instead of giving the exact version in the script) :
set "PhpStormPath=" for /d %%A in ("C:\Program Files\JetBrains\PhpStorm*") do ( set "PhpStormPath=%%~fA" )
You don't have to do any of that if you use the JetBrains Toolbox App.
This is something that was incorporated in the core of the Intellej familty of products so I don't think this thread is relevant any longer
Pretty sure there's no Explorer integration for directories yet.
@jcwillox sorry the response took so long, this appears to happen no matter what command I run just for reference.
Also the path exists and these are the folders in there:
