Directory.GetCurrentDirectory
<p>I've written a program that checks if it is in a specific folder;
if not, it copies itself into that folder,run the copied program and exit.
but the problem is when I call
<code>Directory.GetCurrentDirectory();</code>
 in the copied program(only when It runs by the first one) I get the directory of the first program not the copied one.
What's the problem here?</p>

<p>the code:</p>

<pre><code>if(Directory.GetCurrentDirectory()!=dir)
{
      File.Copy(Application.ExecutablePath,dir+name);
      System.Diagnostics.Process.Start(dir+@"\"+name);
      System.Environment.Exit(System.Environment.ExitCode);
}
</code></pre>

<p>i summarized my codes.</p>
