A customer reported that when they right-clicked a batch file, a bunch of commands were missing. For example, Open was gone!

Okay, there really isn't much of a story here, because some direct debugging quickly identified the culprit.

The customer had installed a third party shell extension which returned a huge value from its IContext­Menu::Query­Context­Menu method.

Explorer told the shell extension, "Hey, like I've got room for 30,000 menu items. How many do you need?"

The shell extension replied, "I'll take 29,995 of them."

And so the shell extension sucked up nearly all the menu IDs, and by the time the Open command handler came along, the context menu host said, "Sorry, I'm all out."

If you followed along when we created a composite context menu, you could sort of see this problem coming.

Uninstalling the buggy shell extension fixed the problem.