I am developing an application in which I want to add a menu item to context menu which appears when we right click one or more file or folders in Windows Explorer. By selecting multiple files or folder and clicking my item in context menu it should send the path of all the files and folders to my application executable for further processing. Please provide me some code for this if possible in C#.net. I searched on internet it is not possible but I think there should be some way because .NET is highly attached to Windows Shell. And if not possible please provide me code in either of these languages VB, VB.net, C, C++, or any other.
Asked
Active
Viewed 4.4k times
26

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

Aishwarya Shiva
- 3,460
- 15
- 58
- 107
-
1possible duplicate of [Pointers for writing context menu items for windows explorer](http://stackoverflow.com/questions/8671865/pointers-for-writing-context-menu-items-for-windows-explorer) and [C# receiving argumens from Windows Context menu](http://stackoverflow.com/questions/2050509/c-sharp-receiving-argumens-from-windows-context-menu) and [Extending windows explorer context menu](http://stackoverflow.com/questions/8058971/extending-windows-explorer-context-menu) and many more. – Raymond Chen Dec 31 '11 at 16:47
-
[This article](http://web.archive.org/web/20101015055336/http://blogs.msdn.com/b/codefx/archive/2010/09/14/writing-windows-shell-extension-with-net-framework-4-c-vb-net-part-1.aspx) should get you started. Edit - Linked to Web Archive version as original post has been removed. – keyboardP Dec 31 '11 at 16:43
-
This video tutorial definitely covers the Windows Explorer context menu (aka shortcut menu) and should get you started. http://www.youtube.com/watch?v=L36u7GudN8k It's not clear if this works when selecting multiple files. – minnow Dec 31 '11 at 16:48
-
This is a bit late but [this tutorial](http://www.howtogeek.com/howto/windows-vista/add-any-application-to-the-desktop-right-click-menu-in-vista/) shows you exactly what you _wanted_ to do. I hope this helps. – MoonKnight Nov 13 '12 at 11:36
-
There's another tutorial [here](http://www.howtogeek.com/107965/how-to-add-any-application-shortcut-to-windows-explorers-context-menu/ "here") that may be more to the point of what you're looking for. Also, I have this project that pretty much follows that tutorial to register my app to show up on right click on the selected file extensions: https://code.google.com/p/j-search-and-replace Take a look at the `SetRegistry` class and also go over the wiki that explains how to debug in Visual Studio under UAC, which is necessary if you're going to add the registry entries programatically. – Joao Coelho Nov 08 '13 at 03:40
-
See [this article](http://www.codeproject.com/Articles/545781/NET-Shell-Extensions-Shell-Icon-Overlay-Handlers) for detailed answer containing sample project. – Mojtaba Mar 07 '16 at 08:46