Adding context menu item to specific extension via registry - windows

Let's start off by saying I am on Windows 10 and that i've seen many posts about this subject but none seemed to work for me. Looking at this post has solved some issues but I still need some assistance. Add menu item to windows context menu only for specific filetype
What I want to do is add an a specific item to only images (I will start with .jpg) that will say "Upload Image". Here is what I have so far:
I searched for the default value of HKEY_CLASSES_ROOT\.jpg which is jpegfile.
I added this key HKEY_CURRENT_USER\SOFTWARE\Classes\jpegfile\shell\ImagePanel\command
I set command default value to my application directory.
After doing all that, the only thing that changed is the context menu shows my application under "Open with" and doesn't actually have its own spot on the context menu.
Am I doing something wrong here?

Had exactly the same problem, something must have changed in Windows 10.
I finally managed to get it work, here are the keys that worked for me:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\.jpg\Shell\
or this one for all the image extensions:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\image\Shell\
for example this is what I used (the first entry is for loading the icon, just the second one is needed to actually create the new menu item):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\image\shell\Photoshop]
"Icon"="C:\\Program Files\\Adobe\\Adobe Photoshop CS6 (64 Bit)\\Photoshop.exe,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\image\shell\Photoshop\Command]
#="\"C:\\Program Files\\Adobe\\Adobe Photoshop CS6 (64 Bit)\\Photoshop.exe\" \"%1\""

Related

Windows - Add item to the context menu for PNG files for the current user only

I'm trying to create a program for editing the context menu of specific file/folder types. I was trying to use it to edit the .png menu, but the added item isn't showing up.
As far as I'm aware, this should add an item with the label "aaa", but it doesn't appear to do anything
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\pngfile\shell\aaa\command]
#="aaa"
I've tried replacing pngfile with png and .png with no success.
I can find plenty of posts about doing this in HKCR, but not in HKCU, which doesn't require admin privileges to edit. Well, no posts about in HKCU that work for me for whatever reason.
Bonus question: How would I find where I need to put the command for other file types, like .jpg?
EDIT: Found the answer after a bit more searching
What I have to do:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\*\shell\aaa]
#="aaa"
"AppliesTo"=".jpg"
and for .jpg and .png (Not tested, but this is what it says to do.)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\*\shell\aaa]
#="aaa"
"AppliesTo"="System.FileName:\"*.jpg\" OR System.FileName:\"*.png\""
[HKEY_CURRENT_USER\Software\Classes\*\shell\aaa\command]
#="aaa"

Add entry to right-click menu for a specific filetype

What I want
I want to add a custom entry to the menu that appears when right-clicking a .jpg/.jpeg for my program (editing images).
What I tried
I added to HKEY_CLASSES_ROOT\jpegfile\shell a key test, in there a second key command and set the (default) value of that to notepad.exe (just for testing). Because no test entry appeared in the menu, I did the same just unter HKEY_CLASSES_ROOT\Directory where it worked!
The file I click is an JPEG and the default value of HKEY_CLASSES_ROOT.jpg is jpegfile.
(Also tested with txtfile but with no success.)
What did I do wrong to add a custom command to specific filetypes only?
What you did was correct. Possible reasons why it didn't work include:
Windows Update has an annoying tendency in Windows 10 to reset file associations to Windows defaults all the time.
You added this facility to the jpegfile key, but the type .jpg may be associated with a different file-type key.
Go to HKEY_CLASSES_ROOT.jpg and see what the association is (alternatively, type ASSOC .jpg in Command Prompt). If it isn't jpegfile, check what it is, in case you actually want to keep that association.
To give you an example, I have a working right-click menu entry for .png files, which runs the pngout utility on them. I did that by editing the Registry. My current association for .png files is FastStone Image Viewer:
So I changed the shell menu for FastStone's file type key:
And now my right-click menu entry works.

Unable to set DefaultIcon in registry

I am attempting to update the Windows registry to add an icon for my custom file extension, and I have thus far been unsuccessful. My current version is closest to this stackoverflow question. Unfortunately, my file's icon is still one of the generic built-in Windows icons (see screenshot below).
At this point my best guess is perhaps there is something wrong with my .ICO file. I have shared it here on Dropbox
Here is the full registry update I'm making with regedit. As you can see, I am also associating my file extension with a .bat file for execution. That works great. Also the Type displayed in Windows Explorer is PartQuest Archive which is also great (see above screenshot). Alas, no dice with the last entry for the icon.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\pqunzip]
#="PartQuest Archive"
[HKEY_CLASSES_ROOT\pqunzip\shell]
[HKEY_CLASSES_ROOT\pqunzip\shell\open]
[HKEY_CLASSES_ROOT\pqunzip\shell\open\command]
#="\"C:\\MentorGraphics\\PartQuestTools\\SDD_HOME\\common\\win32\\scripts\\pqunzip.bat\" \"%1\""
[HKEY_CLASSES_ROOT\.pqz]
#="pqunzip"
[HKEY_CLASSES_ROOT\.pqz\DefaultIcon]
#="\"C:\\MentorGraphics\\PartQuestTools\\SDD_HOME\\common\\win32\\config\\decrypted.ico\""
I have also attempted adding a ,1 to the end of the file name since the .ICO file appears it may have two icons embedded in it. This is did not make a difference.
For good measure, I have been rebooting after each change. I'm not certain if this is necessary.
Any tips from the Windows experts around here will certainly be appreciated!
So I did a little reverse-engineering to figure out the issue based on 7Zip's file associations. It turns out that the DefaultIcon key entry should be a child of the application, not the file name. So in my case I need it associated with pqunzip rather than .pqz:
[HKEY_CLASSES_ROOT\pqunzip\DefaultIcon]
#="\"C:\\MentorGraphics\\PartQuestTools\\SDD_HOME\\common\\win32\\config\\decrypted.ico\""
For maximal clarity, this is the entire contents of my .req file that works as expected:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\pqunzip]
#="PartQuest Archive"
[HKEY_CLASSES_ROOT\pqunzip\shell]
[HKEY_CLASSES_ROOT\pqunzip\shell\open]
[HKEY_CLASSES_ROOT\pqunzip\shell\open\command]
#="\"C:\\MentorGraphics\\PartQuestTools\\SDD_HOME\\common\\win32\\scripts\\pqunzip.bat\" \"%1\""
[HKEY_CLASSES_ROOT\pqunzip\DefaultIcon]
#="\"C:\\MentorGraphics\\PartQuestTools\\SDD_HOME\\common\\win32\\config\\decrypted.ico\""
[HKEY_CLASSES_ROOT\.pqz]
#="pqunzip"

command prompt anywhere in Windows 7 (native functionality)

I got this tip from a website that "shift + right click" on a folder in explorer in win7 will give us a context menu option by which I can open command prompt right there.
I am looking for a hack that can make this simpler so that whenever I "right click" on a folder in explorer, I always get that "shift + right click" effect.
I am not looking for any info on powertoys.
I need help on exactly what I said above; there has to be some registry hack that makes that "shift" default for every right click on the folder name.
Delete the registry key HKCR\Directory\shell\cmd\Extended. It works for me on the 64-bit version of Windows 7 Ultimate.
http://www.addictivetips.com/windows-tips/windows-7-elevated-command-prompt-in-context-menu/ says you also need to delete HKCR\Drive\shell\cmd\Extended if you want the same to apply for drives shown in Computer, and HKCR\Directory\Background\shell\cmd\Extended for the empty space inside a folder window.
I also had the same question about viewing the cmd prompt without the key combination recently. I am on Windows 8.1 and found that PleaseStand's solution works perfectly.
PleaseStand's solution mentioned worked great for me:
Delete the registry key HKCR\Directory\shell\cmd\Extended.
It works for me on the 64-bit version of Windows 7 Ultimate.
This says you also need to delete HKCR\Drive\shell\cmd\Extended if you want the same to apply for drives shown in Computer,
And HKCR\Directory\Background\shell\cmd\Extended for the empty space inside a folder window.
I might add to anyone who might wonder, HKCR means HKEY_CLASSES_ROOT

How to add a new button to windows explorer?

I want to know how to add a new button in windows explorer. I don't want to create a new toolbar. I just want to add a new button in the same windows explorer standard buttons toolbar and not IE.
I appreciate any help possible.
Regards
I don't think that is supported.
You could probably inject into the process and subclass the window and add the toolbar button if hacky solutions are OK.
I have found this article which seems to satisfy my desires... I'm currently on the path of starting development with the new interfaces and will let you know if they work as needed.
The article: http://www.windowsvistaplace.com/shell-namespace-extension-adding-custom-command-module-items/windows-vista#comment-13115
Thanks for everyone who replied/commented on my question
I got something.
first an article:
http://www.askvg.com/how-to-customize-windows-explorer-command-bar that I found searching for {5c4f28b5-f869-4e84-8e60-f11db97c5cc7} which is the FolderType CLSID for Generic.
You find those in the windows registry in HKEY_LOCAL_MACHINE under the key:
SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes
Read the article it's pretty informative! But if you wanna have code already:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksNoItemsSelected]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksNoItemsSelected\0]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksNoItemsSelected\0\{E7E304C4-3C99-49BD-9E5F-980D15103C50}]
"Icon"="C:\\Windows\\System32\\shell32.dll,3"
"InfoTip"="some bla bla "
"Title"="a button!"
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksNoItemsSelected\0\{E7E304C4-3C99-49BD-9E5F-980D15103C50}\shell]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksNoItemsSelected\0\{E7E304C4-3C99-49BD-9E5F-980D15103C50}\shell\InvokeTask]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksNoItemsSelected\0\{E7E304C4-3C99-49BD-9E5F-980D15103C50}\shell\InvokeTask\command]
#="\"C:\\Users\\DUMMYUSER\\hello.exe\""
Rigth in the middle you have a random CLSID created along with the Title aka button text or label, InfoTip which appears when hovering with the cursor and Icon which sadly doesn't work. At the end there is the command to execute. Change those to your desire, save as a *.reg and just run it.
A bummer has to be said: Does not work on Non-Admin users! I tried it but seems you cannot just replace HKEY_LOCAL_MACHINE with HKEY_CURRENT_USER.

Resources