Results 1 to 6 of 6

Thread: Getting current directory

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    13

    Thumbs up

    Someone's probably posted this question somewhere, but i'm not gonna browse through all of the archives, so here it goes:
    How can a program get the current directory (where it's running from) and save it somehow so it can read the directory and use it in some other event?

    -Alpha187

  2. #2
    Guest
    Use App.path to find out what directory your app is in.

    Code:
    Open "C:\appdirectory.txt" For Output As #1
    Print #1, App.Path
    Close #1
    
    'or
    
    Msgbox App.Path

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Yupp, App.Path would get the path to where the program is located but that may not be the current directory. If you would like to get the current directory use the CurDir function instead.

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    13
    So...
    if i want to open another .exe i should use this right?:

    Shell "App.Path/otherexe.exe", vbNormalFocus

    But why doesn't this work?

  5. #5
    Guest
    Try

    Shell App.Path & "\otherexe.exe", vbNormalFocus


  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    13
    Run-time error '5':

    Invalid Procedure Call or Argument


    Hmmm...

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