Reputation: 131
In a desktop winforms application, I am using the Documents folder to store user data. Some users have redirected this folder to a server location. In Windows 7, I can successfully detect this using:
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
In Windows 8 (specifically 8.1 Update 1), this results in a "\" response when the folder in redirected. It works correctly if it is not redirected.
I need to determine where this redirection is going to in order to access the user data.
Upvotes: 1
Views: 151
Reputation: 131
The issue is actually related to rights.
Visual Studio is running as Administrator, if you run an admin command prompt and type in net use there are no mapped drives. A normal command prompt returns the mapped drives.
By enabling linked locations in the registry as per this article it now returns the value in Visual Studio.
Upvotes: 1