How can I get the path to the context menu selection?

I have a custom entry in the Internet Explorer context menu. I would like to do something with a selected item, for example, run a program that receives this selection as ARGV [1].

For example, if I right click on a file named whatever.zip

that is on my desktop, the following should do: my_binary path \ to \ desktop \ whatever.zip

+1


a source to share


2 answers


You need to change YOUR_BINARY and the file type to do something:

Create RegisterYourBinary.reg file with content:



REGEDIT4

[HKEY_CLASSES_ROOT\.zip]
@="zipfile"

[HKEY_CLASSES_ROOT\zipfile\shell\DoSomething]

[HKEY_CLASSES_ROOT\zipfile\shell\DoSomething\command]
@="YOUR_BINARY \"%1\""

      

+2


a source


add% L as an argument from the explorer context menu when calling your executable. For example: myApp.exe% L



+2


a source







All Articles