How do we get the path to the running Harbour executable?
Moderator: Rathinagiri
-
HGAutomator
- Posts: 202
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
How do we get the path to the running Harbour executable?
I know this function is somewhere, I've used it. But cannot recall how to get the Path of the Harbour executable that's running, in order to extract the folder where it's running from.
- Claudio Ricardo
- Posts: 367
- Joined: Tue Oct 27, 2020 3:38 am
- DBs Used: DBF, MySQL, MariaDB
- Location: Bs. As. - Argentina
Re: How do we get the path to the running Harbour executable?
Hi... Try:
In HMG:
cPath := AllTrim ( GetCurrentFolder ())
In Clipper / Harbour:
cPath := AllTrim ( DirName())
In HMG:
cPath := AllTrim ( GetCurrentFolder ())
In Clipper / Harbour:
cPath := AllTrim ( DirName())
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
WhatsApp / Telegram: +54 911-63016162
Re: How do we get the path to the running Harbour executable?
Hello,Try this function too:
hb_dirbase()
hb_DirBase() ➜ cDirName
returns the application's executable base directory (program statrtup directory).
hb_dirbase()
hb_DirBase() ➜ cDirName
returns the application's executable base directory (program statrtup directory).
Re: How do we get the path to the running Harbour executable?
Hi
Try hb_FNameDir( hb_DirBase() )
Try hb_FNameDir( hb_DirBase() )
-
HGAutomator
- Posts: 202
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: How do we get the path to the running Harbour executable?
hb_dirbase(). Never heard of this one, but it does the trick.
Thanks Claudio, huiyi, and vlademiro.
Thanks Claudio, huiyi, and vlademiro.
Re: How do we get the path to the running Harbour executable?
Correction in my answer.
hb_DirBase() is the correct answer.
Other answer (not best) :
hb_FNameDir (ExeName()) // Requires hbct.hbc
hb_DirBase() is the correct answer.
Other answer (not best) :
hb_FNameDir (ExeName()) // Requires hbct.hbc