|
-
Aug 21st, 2000, 12:36 PM
#1
Thread Starter
New Member
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
-
Aug 21st, 2000, 12:44 PM
#2
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
-
Aug 21st, 2000, 12:46 PM
#3
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.
-
Aug 21st, 2000, 12:59 PM
#4
Thread Starter
New Member
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?
-
Aug 21st, 2000, 01:02 PM
#5
Try
Shell App.Path & "\otherexe.exe", vbNormalFocus
-
Aug 21st, 2000, 01:10 PM
#6
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|