How to go in the directory you were run in to the executable file in VB

It might be easy, but now I'm brain freezing

If I cd into a directory from the command line and then start the VB.net executable application, is there a way to find the directory it was started from.

I currently have an executable in my PATH, but ideally the person would burn the CD to the directory they want the executable to work in.

Is it possible?

0


a source to share


3 answers


IO.Directory.GetWorkingDirectory () will give you the directory where you hit the CD.



+1


a source


You can use this one Environment.CurrentDirectory

.



+1


a source


Environment.CurrentDirectory gives you this information. Note that this property is also assignable, so you can change the current working directory by assigning a new value to it.

0


a source







All Articles