I am trying to add a context menu item to a DLL file. The reason is that I have written an application which retracts and deployed a managed DLL file to the GAC. The application is all good, but now I want the ability to right-click a DLL and just click "copy to GAC".
I've tried to follow instructions as per this question: How add context menu item to Windows Explorer for folders but to no avail. When I right click a DLL, nothing new is appearing.
I've also tried the following: https://winaero.com/blog/add-register-dll-context-menu-commands-for-dll-files-in-windows-10/#comment-22928 – ran the reg file but no result as well.
Maybe there's a hardcoded restriction on DLL files for such actions?
Here's my current registry setup:
Any guidance would be appreciated.
Best Answer
The general steps to achieve this are as follows:
regedit
HKCR\.yourextension
and take note of the default value (in your case,dllfile
)HKCU\Software\Classes
(for user) orHKLM\Software\Classes
(for all users)dllfile
) - if it's not there, create itshell
shell
named as the command you want (refer to image below)command
(Default)
value to be the command you want to execute.%1
will give you the path of the file in context (remember to wrap it in"
due to potential white-space in the path)You seem to have done all the above, so you may be doing something wrong, as this is my result after a quick sanity test:
So, here are a few things I can think of that would make it behave non-intuitively:
HKLM
rather thanHKCU
- due to how inheritance works, I do believe adding it toHKLM
would require a restart, or at best, a shell restartHKCU
but your dll requires elevated permissions to accessThe sample command I used to test this was a good old boring
"C:\Windows\notepad.exe" "%1"