Search code examples
c#windowsparametersregistry

Passing multiple parameters through registry


I have a program that I add into explorer's right click menu. When I run this on a single file or single folder it runs the program with the %1 parameter as stated in the reg key HKCR\*\shell\program\command\myprogram.exe %1 or HKCR\folder for files and folders respectively. This works fine, but the issue is when I select multiple files/folders, because it then executes that program for each of the selected. I know this is what should happen but I want to be able to handle multiple selections as if it was one, then foreach over the parameters. Is there any way I can do this? Any suggestions are much appreciated.


Solution

  • As far as I know there's no way to do it through registry.
    Instead, you will have to create a shell extension.

    Here's a good tutorial about shell extensions:
    http://www.codeproject.com/KB/cs/dateparser.aspx
    And here's a tutorial on writing shell extensions that handle multiple files:
    http://www.codeproject.com/KB/shell/shellextguide2.aspx
    I hope the combination of the two of them will help you create the whole process.