title: Directory.exists returns false for mapped drive in c# coding
body: <p>I am using <code>Directory.Exists()</code> in my windows service (that is programmed in C#, 3.5 framework)to check to see whether a particular directory exists in the drive. When I run in local machine it works fine, meaning I am able to access the directory. </p>
  
  <p>But when I deploy the windows service on a Virtual Machine, and start the service, it is not able to find the directory even though the directory exists. The directory is mapped on as</p>
  
  <pre><code> Q: drive, Q:\\temp\\local\\ folder 
  </code></pre>
  
  <p>But the windows services always returns false for the Directory.Exists(). </p>
  
  <p>However when I give <code>C:\ drive</code> in place of <code>Q:\</code> it works, but does not work for a mapped drive. I have tried with the UNC path, and I have made sure the mapped drive have the administrative rights and infact the read, write and execute permission. But it still returns false.</p>
  
  <p>Can anyone please tell me why? And how to resolve? </p>