Let's assume that I want to select all the
mp3 files in a users
Music library. I can access this library from Windows Explorer by typing
libraries\Music into the path bar (address bar?). However in MATLAB if I try this with
uigetdir it is not found and the default location is opened instead.
[fileName, pathName, ~] = uigetfile('*.mp3', 'Select Song','libraries\Music\');
According to this superuser question, the library is a Windows XML feature and not actually an environment variable. The suggestion there is to have users create environment variables. While my users could do that, I don't want to be IT support for the work group so I want a way to do this entirely from the app itself. I can't rely on hardcoded paths either, as some users have small hard drives and their libraries are pointed to network storage.
Microsoft provides this description using IShellLibrary. But I didn't find any information on using IShellLibrary within MATLAB. The default file window that opens has the libraries on the left-hand toolbar so it's not a big deal to have the user just select their documents or whatever. But it's not that clean.
Is there a way for MATLAB to recognize the user's Windows library location?