Change Directory to where the EXE is

Change Directory to where the EXE is

Postby Ollie » 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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Re: Change Directory to where the EXE is

Postby Enrico Maria Giordano » Thu Jul 12, 2007 10:20 am

Code: Select all  Expand view
CFILEPATH( GETMODULEFILENAME( GETINSTANCE() ) ) + "YOUREXE.EXE"


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Ollie » Thu Jul 12, 2007 2: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 37 guests