c# file move (file is already used by another process)
<p>I am moving files from one folder to another. If I try to move the entire folder to the folder within that particular folder I cannot do that. But if I move it outside it works fine. How can I move my folder to the folder within that folder?</p>

<p><strong>this gives error</strong></p>

<pre><code>  if (System.IO.Directory.Exists(PhysicalPath))
 {
      string sourcePath = "c:\\copypath\\";
      string targetPath = "c:\\copypath\\abc\\";
      System.IO.Directory.Move(sourcePath, targetPath);
 }
</code></pre>

<p><strong>this works fine</strong></p>

<pre><code> if (System.IO.Directory.Exists(PhysicalPath))
 {
      string sourcePath = "c:\\copypath\\";
      string targetPath = "c:\\abc\\";
      System.IO.Directory.Move(sourcePath, targetPath);
 }
</code></pre>
