Re: Getting application startup directory
- Posted by Al Getz <Xaxo at aol.com> May 28, 2005
- 452 views
akusaya wrote: > > I was having the same problem as Al Getz, who made the > "GetStartupDirectory" contribution, which is how to get the location > of the program we created. > > For example, my program which located at c:\xyz\prog.exw > or c:\xyz\prog.exe must know that the application directory is > c:\xyz. > > I was using the same method as Al Getz, that is using > command_line()[2]. > > But after some testing, > * c:\otherdir> exw c:\xyz\prog.exw -- success > > * c:\otherdir> set path=%path%;c:\xyz > c:\otherdir> exw prog.exw -- success > > * c:\xyz> prog.exe -- success > > * c:\otherdir> c:\xyz\prog.exe -- success > > * c:\xyz> exw prog.exw -- fail! since command_line()[2] = "prog.exw", > -- not "c:\xyz\prog.exw" > > > My question is, how to get application directory *reliably*? > > Is there a win32 API or something else to get it? > > Thank you. > > Hi there, That's funny, i couldnt get it to fail on my system... What op sys are you running and what steps did you do to get it to fail? Take care, Al And, good luck with your Euphoria programming! My bumper sticker: "I brake for LED's"