Change Directory to where the EXE is

Post Reply
Ollie
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Change Directory to where the EXE is

Post by Ollie »

I cannot rely on the users' shortcut to ensure I have the right "working directory"

How can I find the name of the directory of the EXE that is being run so I can change to the directory where the EXE is with

DirChange(ALLTRIM( CurDrive() + ":\" + EXEDIR????()))
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Change Directory to where the EXE is

Post by Enrico Maria Giordano »

Code: Select all | Expand

CFILEPATH( GETMODULEFILENAME( GETINSTANCE() ) ) + "YOUREXE.EXE"


EMG
Ollie
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Post by Ollie »

Thank you very much.
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Post Reply