0

For example I have a console application named "myconsole.exe" which path is C:\temp\app\myconsole.exe
I added "C:\temp\app" to the PATH environment variable, Now I open the command prompt, type CD C:\MyProjects and run myconsole, how can I get the path "C:\MyProjects" in myconsole.exe?
enter image description here

  • Does this answer your question? [How can I get the application's path in a .NET console application?](https://stackoverflow.com/questions/837488/how-can-i-get-the-applications-path-in-a-net-console-application) – Pavel Anikhouski May 18 '20 at 09:14

1 Answers1

2

Directory.GetCurrentDirectory method is what you are looking for.

nevermind
  • 2,300
  • 1
  • 20
  • 36