title: .NET Directory.Exists denies existence of mapped network drive when running as admin
body: <p>I'm writing a small .NET program on Windows 7.  One thing it needs to do is to create symbolic links, which seems to require me to have administrator privileges.  It also needs to be able to work with mapped network drives (for example, R:\, which on my system maps to <code>\\titanium\Private\</code>).</p>
  
  <p>I'm using <code>Directory.Exists(path)</code> to verify that a path exists.</p>
  
  <p>When running the program as a regular user (administrator account, but not "as administrator"), this works fine on the mapped network drive.</p>
  
  <p>When running the program as an administrator (with UAC), it fails to find directories that exist.  As a result, the program refuses to acknowledge that <code>R:\Steam Games\</code> is a directory that actually exists.</p>
  
  <p>I'm a bit baffled as to why this is happening.  Using the full UNC path (<code>\\titanium\Private\Steam Games\</code>) also doesn't work.</p>
  
  <p>Has anyone run into this before?  Is there any good workaround?  Do I have to format the paths different (note:  most of them are currently formatted with <code>Path.Combine</code>, so they <em>should</em> be correct).</p>
  
  <p>Thanks for your help.</p>
  
  <p>(As an example, <code>Directory.Exists(@"R:\Steam Games\")</code> returns false when running as an admin, but that folder exists.  The function call correctly returns true when running regularly).</p>
  
  <p>Edit:  The issue indeed appears to be that an administrator is technically a different user account.  I could not even use UNC paths, because I was only logged in to my fileserver under my regular user, not under "Administrator".  As a (relatively hackish) workaround, I just run my program with regular privileges and then use <code>Process.Start</code> to invoke an instance of cmd.exe with the arguments to create a symbolic link (and verb "runas" to get the UAC prompt).</p>