You could first call the folderpicker. Or pickfolder not sure off the top of my head. In any case it will prompt user and "allow access to this folder" explicitly , for the duration of the run time. Then you can freely accessible list dir sub folders etc.