title: How to get application folder when program is started by Windows Task Scheduler
body: <p>I have a console app in c# thats starts on schuled times by the Windows task scheduler.
  The app needs some physical files from its own directory and uses <code>System.IO.Directory.GetCurrentDirectory()</code> for that.</p>
  
  <p>Normal when I start the console app myself, it works perfectly. But when it is started by Windows Task Scheduler, it returns <code>C:\Windows\System32</code>.</p>
  
  <p>Why is this not the application directory and is there another way how I can get the application directory?</p>