6

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

JimDel
  • 4,309
  • 11
  • 54
  • 99
  • under the HKCU>>Network registry key is the defined mapped drives for the user. There is a value for Username in these entries. This value holds the information put into the Connect as box. Is this what you mean by mapped as an administrator? – Sorceri Dec 11 '12 at 19:46
  • 1
    This sounds like a chicked-and-egg question. If the mapping exists then necessarily it was made by the user account under which your program runs. – Hans Passant Dec 11 '12 at 19:50
  • @Sorceri Unfortunately no. See my Addition. – JimDel Dec 11 '12 at 20:29
  • @Hans I agree. But I'm finding that isn't always the case. It's looking like I'll have to use the EnableLinkedConnections key after all. – JimDel Dec 11 '12 at 20:34
  • Does the program have to run under standard rights? If not then you can adjust this via the manifest. http://msdn.microsoft.com/en-us/library/bb756929.aspx – Sorceri Dec 11 '12 at 23:16
  • @Sorceri Yes it does unfortunately. – JimDel Dec 11 '12 at 23:23

1 Answers1

1

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.

mrGrandelag
  • 56
  • 1
  • 4