Reputation: 5946
This may be simple but I have brain freeze on just now
If I cd into a directory from a command line and then run my executable VB.net application, is there a way to detect the directory that it was launched from.
I currently have the executable in my PATH however ideally the person would cd into the directory that they were wanting the executable to act upon.
Is this possible?
Upvotes: 0
Views: 96
Reputation: 158309
Environment.CurrentDirectory gives you that information. Note that this property is also assignable, so you can change the current working directory by assigning a new value to it.
Upvotes: 0
Reputation: 3655
IO.Directory.GetWorkingDirectory() will get you the directory you CD'd to.
Upvotes: 1