Results 1 to 12 of 12

Thread: Retrieving Drive Letter

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2004
    Posts
    279

    Retrieving Drive Letter

    Is it possible to retrieve the Drive letter you're program is on?

    Like for example: C:\

    Not the current folder but just the Drive letter.

    Possible?

  2. #2
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Retrieving Drive Letter

    Quote Originally Posted by Tantrum3k
    Is it possible to retrieve the Drive letter you're program is on?

    Like for example: C:\

    Not the current folder but just the Drive letter.

    Possible?

    VB Code:
    1. Left(App.Path,3)
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2004
    Posts
    279

    Re: Retrieving Drive Letter

    It possible without using App.Path?

    Or does App.Path work also in a DLL? No EXE...

  4. #4
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Retrieving Drive Letter

    Quote Originally Posted by Tantrum3k
    It possible without using App.Path?

    Or does App.Path work also in a DLL? No EXE...
    I am not exactly sure if it will work in a dll or not?
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2004
    Posts
    279

    Re: Retrieving Drive Letter

    I've tried using App.Path and GetCurrentDirectory in my DLL project and when I used them it just exited. Could have been a coincidence, though.

    Any other theories on this?

  6. #6

  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Retrieving Drive Letter

    It depends who calls it. If it is a non-VB program then the global objects (App etc.) won't exist, and COM interfaces most probably won't be referenced (unless it is a C++ COM app or something). That makes it a bit hard.

    If it is a VB program then the global objects will be loaded and so it should work.

    I can't remember the API to find the process path but there is one somewhere so if you find that then use it because it will work much better.

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