Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reproduce "Show in Folder" / "Find Target" via C#

When using Chrome, if you download a file you can then choose an option (Show in Folder) which will open the containing directory and highlight the file. Similarly, if you view the properties of a shortcut you can choose the "Find Target" button for that same functionality. I have tried numerous searches, as well as looking over a decent portions of the MSDN entry on Shell Functions, but to no avail. I assume it's just a simple API call, or series thereof, but I'm not finding it.

like image 670
Dereleased Avatar asked Feb 28 '23 20:02

Dereleased


1 Answers

At the very least, you can do that by invoking "explorer.exe /select,C:\path\to\file". I'm not sure if there is an equivalent API call.

[edit] Here's the Microsoft KB article on Explorer command line switches

like image 52
Rytmis Avatar answered Mar 08 '23 03:03

Rytmis