Uwp Cannot List or access .lnk or url files

299 Views Asked by At

Before I get into further details I wanted to point out that uwp can now know have system wide file access so this issue is not exactly related to that.

With that out of the way, the issue is rather simple to explain, uwp cannot query or access link (.lnk) or weblink files as well as possible other files that I dont know yet.

To be more specific the tools found both in the System.io and the Windows.Storage namespaces are incapable of listing .lnk and url files.

They simply never appear on Queries like the System.IO.Directory.GetFiles StorageItemQueryResult.GetFiles()

While also direct access from path as allowed by functions like StorageFile.GetFileFromPathAsync() or System.IO.File.Open() will cause System.UnauthorizedAccessException: Access is denied.

I am posting knowing full well that this will probably never be answered, the only glimmer of hope is the fact the hidden build in uwp explorer can indeed list the affirmational files.

1

There are 1 best solutions below

1
On

The .lnk file type has limitation to be accessed from UWP app since UWP app's sandboxed and user permission. You can not access this file type from path even using the broadFileSystemAccess Capability. But you can get the file by FileOpenPicker which lets the user choose and open files.