-
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
-
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
-
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.
-
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?
-
Try
Shell App.Path & "\otherexe.exe", vbNormalFocus
-
Run-time error '5':
Invalid Procedure Call or Argument
Hmmm...