Startup location is different from the application's location . 
<p>I need to start my c# application at windows start up. I have tried to add registry key with the application's exe path by using the following two options. </p>

<pre><code>System.Environment.CurrentDirectory
Directory.GetCurrentDirectory()
</code></pre>

<p>But when the windows starts, the folder path is showing to system32 directory instead of the application's directory. So, the code which depends on the current directory is not working properly. How to solve this to achieve to the programs folder ?? I have searched the related posts but no solution is obtained.</p>

<p>Thank you,</p>

<hr>

<p>This code works for me:</p>

<pre><code>Directory.GetParent(System.Windows.Forms.Application.ExecutablePath)
</code></pre>

<p>this gives the directory where the application is placed.</p>

<p>Thanks a lot.</p>
