Note that there are some explanatory texts on larger screens.

plurals
  1. POC#: How to open Windows Explorer windows with a number of files selected
    text
    copied!<p>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 <em>Open File Location</em>. This will open up one windows explorer window for each directory that the files are in, and the files will be selected for you. </p> <p>So let's say we have a bunch of mp3 files in our library where three of them are these:</p> <ul> <li><em>Z:\Music\Thursday Blues\01. I wish it was friday.mp3</em></li> <li><em>Z:\Music\Counting Sheep\01. Sheep #1.mp3</em></li> <li><em>Z:\Music\Counting Sheep\02. Sheep #2.mp3</em></li> </ul> <p>If we select those three (in a view where all of them are visible) and do <em>Open File Location</em> then two explorer windows will pop up. One will be the <em>Z:\Music\Thursday Blues</em> folder with <em>01. I wish it was friday.mp3</em> selected, and the other one will be the *Z:\Music\Counting Sheep** folder with both <em>01. Sheep #1.mp3</em> and <em>02. Sheep #2.mp3</em> selected.</p> <p>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 <code>Process.Start(path)</code>, 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.</p> <hr> <p>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)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload