Read the full article here.
In this post I'll show how to that for context menus for Folders using a Visual Studio Setup Project, so after installing the application, when you right click on a folder, you can see such menu and when you click the menu, folder path will be passed to your application as command-line argument:
To add an item to context menu of folder, the setup should do the following configurations in registry:
HKEY_CLASSES_ROOT
Directory
shell
OpenWithMyApp → (Default): Text of the menu
Icon: "Path to executable"
command → (Default): "Path to executable" "%V"