I'm trying to create a custom context-menu entry for Windows (7) Explorer that will send ALL selected items ton ONE single command.

I've read about MultiSelectModel with a Player value in MSDN Doc but this does not seem to work. That's what I've tried:

  1. under HKEY_CLASSES_ROOT/*/shell created a key "MYVERB"
    1. (Default) for 'myverb' is 'my verb'
  2. under "MYVERB" created a key "COMMAND"
    1. (Default) for 'command' is 'python C:\MyScript.py "%1" "%2" "%3" "%4" "%5"'

This works fine for one item.

But when many items are selected, the script is launched one time for each of them. Instead, I want one only instance to receive all the selected items.

I tried adding a String Value "MultiSelectModel" -> "Player" both under "MYVERB" and "COMMAND" but the behaviour does not change.

Is what I'm trying to do even possible with a script and registry only? What am I doing wrong?

  • This is currently unsolved, even though I accepted Tom's answers to grant the bounty in appreciation of his efforts – Stefano Jan 4 '12 at 16:02

Here is an example:


You don't have to specify any % parameters when you use Player, only the command itself.

You might want to try to use a script that prints the command line to a file so that you know what's happening under the hood. But I think that in this case the specification of "%1" and so on broke it...

  • Thanks Tom. I tried removing the parameters but still having the same problem: one command per file is launched. My command is now simply "C:\test.bat". Any other idea? – Stefano Dec 17 '11 at 11:25
  • You might have to test to see if you are already running/just have run. There might not be a way around this. – soandos Dec 22 '11 at 7:50
  • @Stefano: The MSDN document doesn't really mention how exactly it works, as soandos mentions it is quite possible that it just calls an application one argument at a time and that you will have to gather them and delay execution till after they are received. Do something like "if I don't get another item for 1 second, I have received everything". If you really need them all... – Tamara Wijsman Dec 22 '11 at 12:21
  • Thanks Tom, you are probably right, in any case you are the only one who tried to help! – Stefano Dec 22 '11 at 15:20
  • Why did you accept this answer if it's incorrect? – zenpoy Jul 17 '12 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.