FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Change Directory to where the EXE is
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Change Directory to where the EXE is
Posted: Thu Jul 12, 2007 10:01 AM

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)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Change Directory to where the EXE is
Posted: Thu Jul 12, 2007 10:20 AM
CFILEPATH( GETMODULEFILENAME( GETINSTANCE() ) ) + "YOUREXE.EXE"


EMG
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Change Directory to where the EXE is
Posted: Thu Jul 12, 2007 02:13 PM

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)

Continue the discussion