How to get current working directory path c#?

You can use static Directory class – however current directory is distinct from the original directory, which is the one from which the process was started.

System.IO.Directory.GetCurrentDirectory();

So you can use the following to get the directory path of the application executable:

System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);

Leave a Comment