Windows Libraries are in fact just
xml files which define how to display a collection of folders. They are displayed using a special shell extension which is built in to Windows. Since they are not real folders, files and sub-folders cannot be accessed directly via a path.
With an open explorer window, you can type in the address bar:
This does not seem to work from the
File Name box of open/save dialogs. Nor does it work with the
What you can do about it:
Windows Vista introduced the "Known Folders" concept. It replaces the older "constant special item ID list" (CSIDL) methodology used in XP. There is an excellent post on the Windows Blog; it discusses this change and provides an overview of the
*.library-ms file structure.
Known Folders have GUIDs. To access them via command line, prefix your URI with
knownfolder:. There are dozens defined. To access the current user's
Music folder for example,
run the following command:
This will get you to the pre-defined default music folder. So, if you have changed the library's folder, this will unfortunately not work.
A library's default folder can be accessed programmatically by using IShellLibrary interface, but that is out of the scope of my original question. It seems that the best approach is to either:
- Manually map enviroment variables to their known path
- Or manually map environment variables using their GUID. The advantage here is that you make it a system variable and have it work for all users).