FileTypes: Honoring Drag&Drop context menu shell extension verbs' drop target location

I'm overriding all folders' drag&drop + Alt action via FileTypes dialog and trying to simulate a
right click > Drag'n'drop > WinRAR profile using:
ContextMenu VERB WinRAR_Profile1 ID=78 ITEMMODE

It works however the folders get compressed to their current dir regardless of where I dragged them to.
What would be the correct way of doing this?

Setting CWD to destination lister comes to mind?
However it's not guaranteed that we'll be dragging to a lister.
Dragging any folders to any of the nodes below would compress them to archives inside them.
Supported targets include:

  • source lister
  • a folder inside the source lister
  • destination lister
  • a folder inside the destination lister
  • a breadcrumb bar part
  • a tab

Using the internal copy archive command wouldn't work as the profile being executed is:

  • not default
  • has some advanced winrar options set which dopus doesn't support

Does using {destpath$} get the right folder? That should be the folder you dropped on. (Or if not, {sourcepath$} should be, depending on the type of event.)

Adding a
cd {destpath$)
cd {sourcepath$)
before the command didn't help.
Unless there is some other way to do this.

Is WinRAR using the current directory? The issue might be with how to tell WinRAR the path to use rather than what the paths are.

I think the problem is that the ContextMenu command doesn't simulate a drag&drop menu, only a normal right-click context menu. So even though you initiate it via drag&drop, the command it actually runs is equivalent to right-clicking on the source file and choosing the normal context menu command.

1 Like

I see, this makes sense. It must be the shell extension evaluating the drop target for winrar. Considering how little usage would be gained from implementing a system like that I'd say it's not viable.