I have a fixed folder in desktop called student_names. it contains sub folders and each sub folders contains its files. Now I want to store those sub folders and its correspondi
UWP Applications cannot directly access a folder (except application folders) without the user explicitly providing access to the folder (atleast once).
So in order to always be able to read/write to a specific folder you need to first ask user to select the specific folder. Once the user selects a folder you may save it to FutureAccessList
which will provide you with a token to directly get access to the folder(without user intervention) for future use..
var picker = new FolderPicker();
picker.FileTypeFilter.Add("*");
var folder = await picker.PickSingleFolderAsync();
//add selected folder to FutureAccessList
StorageApplicationPermissions.FutureAccessList.AddOrReplace("futureAccessToken", folder);
From next launch (or any logic that you implement) you can access the folder and list its contents
var folder = await StorageApplicationPermissions.FutureAccessList.
GetFolderAsync("futureAccessToken");
IReadOnlyList fileList = await folder.GetFilesAsync();
So, you just need to provide access to the parent folder (which in your case is student_names) then you will be able to access its sub folders and files.
Hope this helps..