Programmatically select multiple files in windows explorer

前端 未结 8 2012
粉色の甜心
粉色の甜心 2020-11-28 11:01

I can display and select a single file in windows explorer like this:

explorer.exe /select, "c:\\path\\to\\file.txt"

However, I can

8条回答
  •  眼角桃花
    2020-11-28 11:55

    This is one of those questions where it may be good to consider what you're trying to achieve, and whether there's a better method.

    To add some more context - Our company develops a C# client application, which allows users to load files and do stuff with them, kind of like how iTunes manages your MP3 files without showing you the actual file on disk.

    It's useful to select a file in the application, and do a 'Show me this file in Windows Explorer` command - this is what I'm trying to achieve, and have done so for single files.

    We have a ListView which allows users to select multiple files within the application, and move/delete/etc them. It would be nice to have this 'show me this file in windows' command work for multiple selected files - at least if all the source files are in the same directory, but if it's not possible then it's not a major feature.

提交回复
热议问题