Is there a way to determine the physical path for a known folder in a Windows Store JavaScript app? My app manifest declares access to the pictures library and I can get the files for that library:
Windows.Storage.KnownFolders.picturesLibrary.getFilesAsync().then(function (files) {
// do something with files
});
But I’d also like to display to the user the physical path of the picturesLibrary. There is a path property on picturesLibrary, but it’s an empty string. There’s a folderRelativeId value as well, which is "D452C811CB5EB8A4\\Pictures" so it won’t mean much to the user.
I can present the user with a folder picker and allow them to choose the pictures library, then I can get the physical path in the handler for the folder picker. But is there any way to get the path of a known folder directly in code?
You shouldn’t use physical paths like that in your application – the approach you have taken with KnownFolders is the recommended approach.
Trying to navigate a folder programmatically can only be done via either KnownFolders or as you have suggested via a folder picker. The security model will not allow you to do this any other way.