1

I want to add a context-menu item like WinRAR added to files or folder's right click context menu by changing registry keys.

1

In the picture,

Add to "Screen Captures.rar"

WinRAR gets that name "Screen Captures" from the filename. I think WinRAR has a DLL that contains code, that gets this file name and adds dynamically to the context menu.

But in my case, I don't have a DLL so I have to do it manually. Is there any code or argument (like %1 %V etc.) that I can use on the registry keys?

My context menu item will be like:

Send "FILE_OR_FOLDER_NAME_HERE" to Desktop

1 Answer 1

0

A dynamic context menu item like the one WinRAR creates is impossible to do without additional code.

You can set the (Default) value for HKEY_CLASSES_ROOT\<ProgID>\shell\mymenu to a static string as follows:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\txtfile\shell\mymenu]
@="My Menu Entry"

[HKEY_CLASSES_ROOT\txtfile\shell\mymenu\command]
@="%SystemRoot%\\system32\\NOTEPAD.EXE %1"

This will display the following:

1

If you attempt to use %1 or other variables it just won't work since it'll be treated like a literal string and consequently %1 itself will show up in the menu.

2
  • From what I've read on the other post you wrote and external links, I think it is impossible to use managed coding in order to write shell extensions. I only know C#, @Karan if it is possible I could do some coding. ?
    – cagatay117
    Commented May 16, 2015 at 17:21
  • You can write shell extensions in managed code, but is it not advisable. For specific C# related queries you'll need to ask on SO instead.
    – Karan
    Commented May 16, 2015 at 19:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .