Click to See Complete Forum and Search --> : Current Directory
Lev FatMan
July 1st, 2001, 08:12 AM
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
Wrath
July 1st, 2001, 08:46 AM
You could use App.Path which gives you the directory which the exe is in afaik.
vampyre
July 1st, 2001, 08:51 AM
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
shree
July 1st, 2001, 09:08 AM
The VB CurDir function gives the current directory. ChDir changes the current directory.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.