The application I am building relies on access to a mapped network drive. Let's call it "P:\". For the sake of this question let's assume that all users have this drive mapped. All users can access this drive through windows explorer. All users have identical folder structures in P:\, but the shared folder that they link this drive to is locally random. However when they run the program it becomes obvious that in some cases that something went wrong with user privileges/drive setup. For some, the following code:
List<string> dirs = new List<string>(Directory.GetDirectories("P:\\"));
would return an empty list, or a complaint that "P:\" simply does not exist. The question is: is it possible to correctly, automatically resolve the correct privileges needed to work correctly with P:\ drive and carry on without having the users to go through re-configuring the mapping?