I want to write a simple C # console application to change the current command line directory to the directory in which the application is running. Looking through the MSDN System.IO.Directory.SetCurrentDirectory , it looks perfect for this, until I saw in the comments that:
'When the application terminates, the working directory is restored to its original location (the directory where the process was started).
And of course, when I tried this in a test application, it did not work. Does anyone know how to implement a CD option in C #?
source
share