Tutorial :how can I get the path of a context menu selection?



Question:

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

For example, if I right click on a file named whatever.zip that is located on my desktop, the following thing should run : my_binary path\to\desktop\whatever.zip


Solution:1

You need change YOUR_BINARY and the filetype to do something:

Create a file called RegisterYourBinary.reg with the content:

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


Solution:2

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »