Is there a way to find out if the mapped drive has been mapped as an administrator or standard user with C #?

As I understand it, the mapped drive is not accessible to standard users when it was created by the administrator and vice versa. Is there any way to tell programmatically how the drive was mapped? Administrator or standard user? I know about the EnableLinkedConnection registry entry, which allows you to map drives to everyone, but I don't want this to be necessary.

EDIT: Here are the scenarios that I come across. The drive is displayed as an administrator. But a program that works with standard rights cannot see this disk.

thanks

+6
source share
1 answer

I assume that your code is running in a window of Windows7 or later.

As Sorceri notes in his comment, your application can run under standard rights, and you used elevated rights to map the drive.

If so, you have 2 solutions:

  • Or install the program on higher privileges

  • Check access rights to shared resources and files on the resource you own.

Hopes this helps.

+1
source

All Articles