6

I'm adding a Context Menu Item to the windows registry so when I click on a file I can call my application and have that file be set to my application as an arg. But how can I do this with to have multiple files be send to my application (all the files I have selected)?

right now I have the command as:

"C:/test.dll" "%1"

But this seems to call in each file separately. what's the command to throw in all the files that I have selected?

Cœur
  • 37,241
  • 25
  • 195
  • 267
user1255276
  • 541
  • 2
  • 5
  • 20
  • Please see this [relevant post](http://stackoverflow.com/questions/4871620/how-to-pass-multiple-params-in-batch) That should help you out. – Jis Ben May 16 '12 at 17:20
  • Thanks Jis Ben :) but for some reason none of these seemed to work. They all still get added in separately or don't work. Like when I try %* a file with no name gets thrown in instead of all the files. And when i try %1 %2 %3 the file name gets thrown in along with %2 %3 appended to the end of it. Must be different when you call from the registry or something? – user1255276 May 16 '12 at 17:37
  • 1
    If you leave it as the `%1` and try 2 files, does the app get called twice, once with each file? Just thinking that the answer in that case is to have the second copy of the app tell the first copy its command line and then the first copy can handle both files. – Joel Rondeau Jun 07 '12 at 18:09
  • Looks like you have to write a shell extension or do as Joel suggested. Duplicate: http://stackoverflow.com/questions/2315990/pass-multiple-files-folders-from-windows-explorer-to-external-application – Bob Jun 09 '12 at 02:42

1 Answers1

0

Use "%*" to pass all the elements from the command line to another app.

Sergey K.
  • 24,894
  • 13
  • 106
  • 174
  • 1
    Hi Sergey Thanks for the comment :), but like I mentioned before I tried the %* but through the registry it doesn't seem to work. I did read somewhere else how ever that you need to make a bat file that does the command line call such that the %* would work and then have your registry point to the bat file. But again when doing that windows still opened each file into its own application. – user1255276 Jun 11 '12 at 13:26