title: C# Could not find a part of the path with Directory.GetDirectories
body: <p>I'm trying to make an application that copies volume to a selected location in the computer.
  The volume is an external hard disk that includes a copy of my previous computer C volume.</p>
  
  <p>First of all, when I tried to copy the directories and the files I made an recursive function that gets the directories and the files and copy them to the new location, the recursive function gets the directories with Directory.GetDirectories function, after I get the sub directories I make the same function to get the sub directories of the sub directories and keeps doing that untill there are no directories to get, all works fine but when I tried to use the application on my volume I got an infiniate loop with "Application Data" folder, that means that the GetDirectories function found "Application Data" folder in the previous "Application Data" again and again.
  In order to fix that I checked if the path does not include "Application Data\Application Data" and just the I used the GetDirectories function.
  Maybe that solution caused the problem I'm going to ask about.</p>
  
  <p>The problem is that when I use the function GetDirectories I get an exception: "Could not find a part of the path" but my code looks like this:</p>
  
  <pre><code>if(Directory.Exist(path))
  {
      string[] subdirs = Directory.GetDirectories(path);
  }
  </code></pre>
  
  <p>So how is that possible that the Exist function finds the folder but the GetDirectories function does not find it?
  By the way, the application works properly on directories that are not part of windows system.
  So what is the problem? And how can I solve it or how can I make copy application that will copy C volume?
  Thanks a lot</p>