Results 1 to 5 of 5

Thread: Trying to find the path where my program is installed

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    Trying to find the path where my program is installed

    Hi guys. I'm making a program that has a text file and a configuration file that are stored in my programs installation path, but I am having difficulties setting a variable to the path my program is currently installed to, where my Readme.txt and config file will be. I need this path in a variable so I can use it to read these files. It's gotta be some variation on a GetDirectory like method. Does anyone have an idea how I can do this? For some reason, I just can't find the info I need and I'm new to VB (Though I am moderately skilled with C++) Thanks.

  2. #2
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: Trying to find the path where my program is installed

    Application.StartupPath (which would make jmcilhinny cringe)

    or

    | DataDirectory |
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  3. #3
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: Trying to find the path where my program is installed

    use the following...

    Code:
    Dim strPath as string=Application.StartupPath.ToString
    If my post helps , please feel free to rate it

  4. #4
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: Trying to find the path where my program is installed

    Application.StartupPath returns a string so there is no need to call the ToString method at the end.
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    Re: Trying to find the path where my program is installed

    Thank you so much for the help, you guys. I should have guessed that it was in the application class. Have a wonderful day and happy coding, my friends!

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