Search code examples
c#.netuwpwindows-10-universalstoragefolder

Request permanent access to a folder from UWP application


At the startup of my application, it should scan the files of a given folder. The folder is in an arbitrary path defined by the user, for instance "E:\Files"

I could make the user choose an StorageFolder using a FolderPicker.PickSingleFolderAsync, but doing this every time the app starts would be really inconvenient.

Is there a way to request permanent access to the user defined folder and save it to the Application Settings in order to avoid asking the user every time the apps wants to access it?

I have seen some applications that give you the option to add folders to a list and they get permanent access, but I don't know how to do it.


Solution

  • There are two options:

    1. Use FutureAccessList or MostRecentlyUsedList
    2. Use new broadFileSystemAccess capability (available in latest windows 10 version). (Note: you will have to justify your needs of this capabilities during package submission).