Ultimately, I want to be able to do this for a file dialog in C++ code, but being able to do it from a command line would be a good start...
For the 'standard' libraries - Documents, Music, Pictures, and Videos - I know there are special 'shell:' names that work (list here ).
So, for example,
explorer.exe shell:PicturesLibrary
will open an explorer directly in the Pictures library view.
But I've created a new library, say 'My Library', and I can't find any way to open an explorer directly in 'My Library'. Best I can do so far is to open 'shell:Libraries' and force the user to descend from there.
Anyone know?
This console app starts off by using SHGetKnownFolderPath to get the path to the user's libraries folder. Then it uses ShellExecute to "explore" the "My Library" library file within this directory.
The string given by SHGetKnownFolderPath is freed by CoTaskMemFree. Also, SHGetKnownFolderPath doesn't have an ANSI version, so I just made everything wide-character-explicit.
No error checking is included, so you might want to add that.
From the command-line, this does something similar: