Creating a shell extension that applies only to files with a very specific name
Today’s Little Program isn’t even a program. It demonstrates how to register a shell context menu command that applies only to files with a specific name.
Let’s say that you want a special context menu command, let’s call it Party!, on any file called
party.txt. If invoked, it runs CharMap because everybody knows that CharMap is a total party animal.
Now, if you wanted the command to apply to any text file, you would use the following registration:
But this offers the Party! command on humorless files like
Fixing this is a special case of getting dynamic behavior for static verbs by using Advanced Query Syntax. In this case, we create an Advanced Query Syntax filter that selects an exact file name.