Results 1 to 3 of 3

Thread: [02/03] working directory...............

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    20

    [02/03] working directory...............

    hi there
    is there a way to get the the path of the working directory where the vb.net program is run, as a string?

    thanking you.

  2. #2
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: [02/03] working directory...............

    what do you mean by "working directory"?

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [02/03] working directory...............

    The working directory and the directory where the program was run from are not necessarily the same thing. You get the path of the folder containing the current app's executable using Application.StartupPath and the path of the executable itself using Application.ExecutablePath. Neither of those properties will change over the course of a session. The working directory is found using Environment.CurrentDirectory. It may be changed, either explicitly by your code, by the user when using a FileDialog or various other means.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width