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

Karan
  • 57,289

1 Answers1

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.

Karan
  • 57,289