Is there a way to tell if a mapped drive was mapped as an Administrator or Standard User With C#?

StackOverflow https://stackoverflow.com/questions/13826097

سؤال

As I understand it, a mapped drive isn't available to a standard user when it was created by an administrator and vice versa. Is there a way to tell programatically how the drive was mapped? By an Admin or by a standard user? I know about the Registry entry EnableLinkedConnection, which allows mapped drives to be available to all, but I don't want that to be necessary.

EDIT: Here's a scenarios I'm running into. A drive is mapped as an administrator. But a program running with standard rights can't see that drive.

Thanks

هل كانت مفيدة؟

المحلول

I assume your code is running on a Windows7 or newer box.

As Sorceri hints in his comment, your app might be running under standard rights, and you used elevated rights to map the drive.

If this is the case, you have 2 solutions:

  1. Either set the program to run with higher privileges

  2. Check the share and file security on the share you are mapping.

Hopes this helps.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top