|
-
July 1st, 2001, 08:12 AM
#1
Current Directory
Hello,
How do I get the current working directory of the exe file. Like when I lunch the open dialog box it enters the current directory, I need to know what it is...
Thank you all, you made my life easier for so many times.
FatMan
-
July 1st, 2001, 08:46 AM
#2
Re: Current Directory
You could use App.Path which gives you the directory which the exe is in afaik.
-
July 1st, 2001, 08:51 AM
#3
Re: Current Directory
The GetCurrentDirectory API function returns the current working cirectory of the currens process (application). I think that's what you need.
'in a module
public Declare Function GetCurrentDirectory Lib "kernel32" Alias "GetCurrentDirectory" (byval nBufferLength as Long, byval lpBuffer as string) as Long
'in your code
Dim sTemp as string
sTemp = Space$(255)
GetCurrentDirectory(255,sTemp)
sTemp = Left(sTemp, InStr(1,sTemp,vbNullChar)-1)
I hope that answers your question
-
July 1st, 2001, 09:08 AM
#4
Re: Current Directory
The VB CurDir function gives the current directory. ChDir changes the current directory.
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
|