In the Library of Windows Media Player you can select one or more music files. You can then right-click and in their context menu choose Open File Location. This will open up one windows explorer window for each directory that the files are in, and the files will be selected for you.
So let's say we have a bunch of mp3 files in our library where three of them are these:
- Z:\Music\Thursday Blues\01. I wish it was friday.mp3
- Z:\Music\Counting Sheep\01. Sheep #1.mp3
- Z:\Music\Counting Sheep\02. Sheep #2.mp3
If we select those three (in a view where all of them are visible) and do Open File Location then two explorer windows will pop up. One will be the Z:\Music\Thursday Blues folder with 01. I wish it was friday.mp3 selected, and the other one will be the *Z:\Music\Counting Sheep** folder with both 01. Sheep #1.mp3 and 02. Sheep #2.mp3 selected.
How can I do this myself in C#? We have an application which is going to export data to various formats, for example CSV and Excel, and I would like to open up explorer windows with these files selected when they are created and ready to be viewed. Currently I just do Process.Start(path), and this works but I would love to be able to highlight those particular files as well. Would make the files that were just created much more obvious.
Windows Media Player does it so well... I want to do it too =/ Are there any Microsoft employees here that could figure out how it can be done? (A)