• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

vb.net 2.0 console application execution path

I want to know how to get reference to the current directory of my console app.  I have a file i want to access and dont want to have the location be hard coded.

0
ibidata
Asked:
ibidata
  • 2
  • 2
1 Solution
 
AlexFMCommented:
See Environment.CurrentDirectory Property.
0
 
AlexFMCommented:
BTW, if you want to open file in current directory, you can open it using only name without path.
0
 
PockyMasterCommented:
Application.StartupPath() will work as well
0
 
PockyMasterCommented:
Oops.. console application.. nothing said :D
0
 
ibidataAuthor Commented:
cool, thanks!  FYI for anyone in the future, current directory = bin\debug (for development at least)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now