blog.plee.me About software, technology and random things

7Sep/170

Open PhpStorm From Windows Explorer Context Menu For Directories

Hello!

If you are a bit lazy like me and just want to simply open PhpStorm from the directory that you've currently navigated to in Windows Explorer, you can use this .reg file to add the registry entries for the entry in the context menu.

Warning: This involves messing around a bit with the registry. Please make sure you understand what you are doing!

This .reg file assumes that the path to your PhpStorm installation is C:\Program Files (x86)\JetBrains\PhpStorm 2017\. If it is not, just search and replace every occurrence of the path in the .reg file with the one that applies for you. Remember to escape backslashes with a backslash!

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\*\shell\Aphpstorm]
[-HKEY_CLASSES_ROOT\Folder\shell\Aphpstorm]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Aphpstorm]

[HKEY_CLASSES_ROOT\*\shell\Aphpstorm]
@="Open Directory in PhpStorm"
"Icon"="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe"

[HKEY_CLASSES_ROOT\*\shell\Aphpstorm\command]
@="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe \"%1\""

[HKEY_CLASSES_ROOT\Folder\shell\Aphpstorm]
@="Open Directory in PhpStorm"
"Icon"="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe"

[HKEY_CLASSES_ROOT\Folder\shell\Aphpstorm\command]
@="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe \"%1\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\Aphpstorm]
@="Open Directory in PhpStorm"
"Icon"="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe"
;"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\Aphpstorm\command]
@="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe \"%V\""

Instructions: Just copy the text into a text file, save it as a file with the .reg extension (e.g. "phpstorm.reg") and execute it via double-click. When asked if you want to continue modifying the registry, confirm with "Yes".

Note: You might wonder why the registry paths contain a segment called "Aphpstorm" instead of "phpstorm" (or anything else). This is so that this entry takes alphabetic precedence over other entries and it is sorted further up. It will not influence the text displayed in the context menu.

Unfortunately I do not know the exact source for this neat little trick because I got this from a colleague at work.

If you wish to revert these changes at some point, just do what the first three instructions in the .reg file do: delete the 3 appropriate keys in the registry.

I hope this is useful to you! It sure is for me.

Thanks for reading!

13Aug/090

Disabling Windows Vista / 7 / 8 / 10 Explorer’s Automatic Folder Type Discovery

Hey!

Update from 2015-09-06: I just used this for Windows 10 and it still works!

I very recently installed Windows 7 on my desktop computer and I'm loving it so far.

One of the major things that bugged me though was the new Explorer behavior. The automatic folder type discovery just goes ahead and tries to determine a folder type just by looking at how many (or if there are) files of a certain type (pictures, videos, songs, ...) are in the current folder, and then it adjusts the viewing settings accordingly. For example, if you open a folder that contains mainly video files, it would show those with big icons instead of my default, a detailed list. Pictures are displayed as thumbnails.

Disabling this behavior proved to be interestingly difficult. As with most things that have been declared a default setting by Microsoft, it luckily can be done - but only via registry.

First we need to delete our current folder type settings.

  • Close all open Explorer windows.
  • Open the registry editor with Start => Run => regedit and browse to HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell.
  • Delete and confirm the deletion of the keys BagMRU and Bags.
  • Now create a Key (right-click on the current key in the left pane and select New => Key) called Bags.
  • Create a subkey for Bags called AllFolders.
  • Create a subkey for AllFolders called Shell.
  • Create a String value (right-click in the right pane and select New => String Value) called FolderType and set the value to NotSpecified.
  • That's it for Windows 7. Please read the note for Windows Vista x64 below. Otherwise, just reboot and your new settings should be applied.

That's it for Windows 7. If you're using Windows Vista x64, it might be possible that there is a copy of (or a similar) the Local Settings\Software\Microsoft\Windows\Shell key in HKEY_CURRENT_USER\Software\Classes\Wow6432Node. I could not confirm this for Windows 7, though I am using the 64 bit version (it just had a CLSID subkey, nothing more). In that case, delete the Shell\Bags and Shell\BagMRU folders like I told you above before finishing your modifications with a reboot.

Warning: as always, playing around with the Windows registry can be dangerous when done incorrectly. If you do not feel safe about it, make sure to back up the keys you're about to modify via File => Export, or leave it altogether. I do not take any responsibility for any damage, nor do I give any guarantee that the steps I provided here will work for you. At least they worked for me.

Hopefully that was of help to you 🙂

I discovered the initial instructions on mydigitallife.info. Thank's so much 🙂 Had a hard time finding a guide for that.

   
%d bloggers like this: